Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
c0bb32d7
Commit
c0bb32d7
authored
Apr 30, 2024
by
Yanyutin753
Browse files
📌
fixed a bug where RAG would not reply after not reading the file correctly
parent
5e168e6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
backend/apps/rag/utils.py
backend/apps/rag/utils.py
+6
-2
No files found.
backend/apps/rag/utils.py
View file @
c0bb32d7
...
@@ -321,8 +321,12 @@ def rag_messages(
...
@@ -321,8 +321,12 @@ def rag_messages(
context_string
=
""
context_string
=
""
for
context
in
relevant_contexts
:
for
context
in
relevant_contexts
:
items
=
context
[
"documents"
][
0
]
try
:
context_string
+=
"
\n\n
"
.
join
(
items
)
if
"documents"
in
context
:
items
=
[
item
for
item
in
context
[
"documents"
][
0
]
if
item
is
not
None
]
context_string
+=
"
\n\n
"
.
join
(
items
)
except
Exception
as
e
:
log
.
exception
(
e
)
context_string
=
context_string
.
strip
()
context_string
=
context_string
.
strip
()
ra_content
=
rag_template
(
ra_content
=
rag_template
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment