From 049b3136e8d75b50bc881f91babb1726561caad0 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 11 Jun 2024 00:24:25 -0700 Subject: [PATCH] refac --- backend/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/main.py b/backend/main.py index fa9563e13..4376da288 100644 --- a/backend/main.py +++ b/backend/main.py @@ -284,6 +284,7 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): context = "" for tool_id in data["tool_ids"]: + print(tool_id) response = await get_function_call_response( prompt=prompt, tool_id=tool_id, @@ -291,10 +292,9 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): task_model_id=task_model_id, user=user, ) - print(response) if response: - context = ("\n" if context != "" else "") + response + context += ("\n" if context != "" else "") + response if context != "": system_prompt = rag_template( @@ -304,7 +304,7 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): print(system_prompt) data["messages"] = add_or_update_system_message( - f"\n{system_prompt}", data["messages"] + f"\n{system_prompt}", data["messages"] ) del data["tool_ids"]