mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
fix: truncate tool call results to 50 characters for cleaner output
This commit is contained in:
@@ -57,4 +57,8 @@ class ClassicAgent(BaseAgent):
|
|||||||
)
|
)
|
||||||
|
|
||||||
yield {"sources": retrieved_data}
|
yield {"sources": retrieved_data}
|
||||||
|
# clean tool_call_data only send first 50 characters of tool_call['result']
|
||||||
|
for tool_call in self.tool_calls:
|
||||||
|
if len(str(tool_call["result"])) > 50:
|
||||||
|
tool_call["result"] = str(tool_call["result"])[:50] + "..."
|
||||||
yield {"tool_calls": self.tool_calls.copy()}
|
yield {"tool_calls": self.tool_calls.copy()}
|
||||||
|
|||||||
@@ -87,6 +87,10 @@ class ReActAgent(BaseAgent):
|
|||||||
)
|
)
|
||||||
|
|
||||||
yield {"sources": retrieved_data}
|
yield {"sources": retrieved_data}
|
||||||
|
# clean tool_call_data only send first 50 characters of tool_call['result']
|
||||||
|
for tool_call in self.tool_calls:
|
||||||
|
if len(str(tool_call["result"])) > 50:
|
||||||
|
tool_call["result"] = str(tool_call["result"])[:50] + "..."
|
||||||
yield {"tool_calls": self.tool_calls.copy()}
|
yield {"tool_calls": self.tool_calls.copy()}
|
||||||
|
|
||||||
final_answer = self._create_final_answer(query, self.observations, log_context)
|
final_answer = self._create_final_answer(query, self.observations, log_context)
|
||||||
|
|||||||
Reference in New Issue
Block a user