feat: add clsx dependency, enhance logging in agent logic, and improve agent logs component

This commit is contained in:
Siddhant Rai
2025-04-28 14:18:28 +05:30
parent 8289b02ab0
commit 4979e1ac9a
17 changed files with 254 additions and 121 deletions

View File

@@ -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()}