mirror of
https://github.com/open-webui/open-webui
synced 2024-11-24 04:54:12 +00:00
fix: query generation
This commit is contained in:
parent
3cfd4f8993
commit
429fa2befa
@ -515,6 +515,7 @@ async def chat_completion_files_handler(
|
||||
) -> tuple[dict, dict[str, list]]:
|
||||
sources = []
|
||||
|
||||
if files := body.get("metadata", {}).get("files", None):
|
||||
try:
|
||||
queries_response = await generate_queries(
|
||||
{
|
||||
@ -540,7 +541,6 @@ async def chat_completion_files_handler(
|
||||
|
||||
print(f"{queries=}")
|
||||
|
||||
if files := body.get("metadata", {}).get("files", None):
|
||||
sources = get_sources_from_files(
|
||||
files=files,
|
||||
queries=queries,
|
||||
@ -691,6 +691,7 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware):
|
||||
|
||||
# If context is not empty, insert it into the messages
|
||||
if len(sources) > 0:
|
||||
print("\n\n\n\n\n\n\nHI\n\n\n\n\n\n")
|
||||
context_string = ""
|
||||
for source_idx, source in enumerate(sources):
|
||||
source_id = source.get("source", {}).get("name", "")
|
||||
|
Loading…
Reference in New Issue
Block a user