From eb21750466f852dd00a094dd0cfbc5f5e8048abc Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 18 Jun 2024 14:38:23 -0700 Subject: [PATCH] fix: files --- backend/main.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/main.py b/backend/main.py index 7f82dd7c7..b9fc7dd74 100644 --- a/backend/main.py +++ b/backend/main.py @@ -354,10 +354,10 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): print(f"tool_context: {context}") # If docs field is present, generate RAG completions - if "docs" in data: + if "files" in data: data = {**data} rag_context, citations = get_rag_context( - docs=data["docs"], + docs=data["files"], messages=data["messages"], embedding_function=rag_app.state.EMBEDDING_FUNCTION, k=rag_app.state.config.TOP_K, @@ -369,8 +369,7 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): if rag_context: context += ("\n" if context != "" else "") + rag_context - del data["docs"] - + del data["files"] log.debug(f"rag_context: {rag_context}, citations: {citations}") if context != "": @@ -1380,7 +1379,6 @@ async def update_pipeline_valves( ) - @app.get("/api/config") async def get_app_config(): # Checking and Handling the Absence of 'ui' in CONFIG_DATA