mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
fix: thought param in /api/answer
This commit is contained in:
@@ -611,6 +611,7 @@ class Answer(Resource):
|
|||||||
source_log_docs = []
|
source_log_docs = []
|
||||||
tool_calls = []
|
tool_calls = []
|
||||||
stream_ended = False
|
stream_ended = False
|
||||||
|
thought = ""
|
||||||
|
|
||||||
for line in complete_stream(
|
for line in complete_stream(
|
||||||
question=question,
|
question=question,
|
||||||
@@ -633,6 +634,8 @@ class Answer(Resource):
|
|||||||
source_log_docs = event["source"]
|
source_log_docs = event["source"]
|
||||||
elif event["type"] == "tool_calls":
|
elif event["type"] == "tool_calls":
|
||||||
tool_calls = event["tool_calls"]
|
tool_calls = event["tool_calls"]
|
||||||
|
elif event["type"] == "thought":
|
||||||
|
thought = event["thought"]
|
||||||
elif event["type"] == "error":
|
elif event["type"] == "error":
|
||||||
logger.error(f"Error from stream: {event['error']}")
|
logger.error(f"Error from stream: {event['error']}")
|
||||||
return bad_request(500, event["error"])
|
return bad_request(500, event["error"])
|
||||||
@@ -664,6 +667,7 @@ class Answer(Resource):
|
|||||||
conversation_id,
|
conversation_id,
|
||||||
question,
|
question,
|
||||||
response_full,
|
response_full,
|
||||||
|
thought,
|
||||||
source_log_docs,
|
source_log_docs,
|
||||||
tool_calls,
|
tool_calls,
|
||||||
llm,
|
llm,
|
||||||
|
|||||||
Reference in New Issue
Block a user