From f6c88da81b34c0124068969f5d3c678af82e267e Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 7 Apr 2025 11:03:49 +0100 Subject: [PATCH] fix: thought param in /api/answer --- application/api/answer/routes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/api/answer/routes.py b/application/api/answer/routes.py index 7f61880d..2f158b5b 100644 --- a/application/api/answer/routes.py +++ b/application/api/answer/routes.py @@ -611,6 +611,7 @@ class Answer(Resource): source_log_docs = [] tool_calls = [] stream_ended = False + thought = "" for line in complete_stream( question=question, @@ -633,6 +634,8 @@ class Answer(Resource): source_log_docs = event["source"] elif event["type"] == "tool_calls": tool_calls = event["tool_calls"] + elif event["type"] == "thought": + thought = event["thought"] elif event["type"] == "error": logger.error(f"Error from stream: {event['error']}") return bad_request(500, event["error"]) @@ -664,6 +667,7 @@ class Answer(Resource): conversation_id, question, response_full, + thought, source_log_docs, tool_calls, llm,