mirror of
https://github.com/open-webui/open-webui
synced 2025-02-16 18:22:29 +00:00
refac
This commit is contained in:
parent
1db1ef7c26
commit
8eb45acf10
@ -403,9 +403,7 @@ def get_rag_context(
|
|||||||
)
|
)
|
||||||
|
|
||||||
contexts.append(
|
contexts.append(
|
||||||
(", ".join(file_names) + ":\n\n")
|
((", ".join(file_names) + ":\n\n") if file_names else "")
|
||||||
if file_names
|
|
||||||
else ""
|
|
||||||
+ "\n\n".join(
|
+ "\n\n".join(
|
||||||
[text for text in context["documents"][0] if text is not None]
|
[text for text in context["documents"][0] if text is not None]
|
||||||
)
|
)
|
||||||
@ -422,7 +420,9 @@ def get_rag_context(
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception(e)
|
log.exception(e)
|
||||||
|
|
||||||
print(contexts, citations)
|
print("contexts", contexts)
|
||||||
|
print("citations", citations)
|
||||||
|
|
||||||
return contexts, citations
|
return contexts, citations
|
||||||
|
|
||||||
|
|
||||||
|
@ -1042,7 +1042,7 @@ CHUNK_OVERLAP = PersistentConfig(
|
|||||||
DEFAULT_RAG_TEMPLATE = """You are given a user query, some textual context and rules, all inside xml tags. You have to answer the query based on the context while respecting the rules.
|
DEFAULT_RAG_TEMPLATE = """You are given a user query, some textual context and rules, all inside xml tags. You have to answer the query based on the context while respecting the rules.
|
||||||
|
|
||||||
<context>
|
<context>
|
||||||
[context]
|
{{CONTEXT}}
|
||||||
</context>
|
</context>
|
||||||
|
|
||||||
<rules>
|
<rules>
|
||||||
@ -1055,7 +1055,7 @@ DEFAULT_RAG_TEMPLATE = """You are given a user query, some textual context and r
|
|||||||
</rules>
|
</rules>
|
||||||
|
|
||||||
<user_query>
|
<user_query>
|
||||||
[query]
|
{{QUERY}}
|
||||||
</user_query>
|
</user_query>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user