mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
feat: add clsx dependency, enhance logging in agent logic, and improve agent logs component
This commit is contained in:
@@ -48,15 +48,13 @@ class ClassicAgent(BaseAgent):
|
||||
):
|
||||
yield {"answer": resp.message.content}
|
||||
else:
|
||||
# completion = self.llm.gen_stream(
|
||||
# model=self.gpt_model, messages=messages, tools=self.tools
|
||||
# )
|
||||
# log type of resp
|
||||
logger.info(f"Response type: {type(resp)}")
|
||||
logger.info(f"Response: {resp}")
|
||||
for line in resp:
|
||||
if isinstance(line, str):
|
||||
yield {"answer": line}
|
||||
|
||||
log_context.stacks.append(
|
||||
{"component": "agent", "data": {"tool_calls": self.tool_calls.copy()}}
|
||||
)
|
||||
|
||||
yield {"sources": retrieved_data}
|
||||
yield {"tool_calls": self.tool_calls.copy()}
|
||||
|
||||
Reference in New Issue
Block a user