Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions application/agents/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
model=self.gpt_model, messages=messages, tools=self.tools
)
if log_context:
data = build_stack_data(self.llm)
data = build_stack_data(self.llm, exclude_attributes=["client"])

Check warning on line 259 in application/agents/base.py

View check run for this annotation

Codecov / codecov/patch

application/agents/base.py#L259

Added line #L259 was not covered by tests
log_context.stacks.append({"component": "llm", "data": data})
return resp

Expand All @@ -272,6 +272,6 @@
self, resp, tools_dict, messages, attachments
)
if log_context:
data = build_stack_data(self.llm_handler)
data = build_stack_data(self.llm_handler, exclude_attributes=["tool_calls"])

Check warning on line 275 in application/agents/base.py

View check run for this annotation

Codecov / codecov/patch

application/agents/base.py#L275

Added line #L275 was not covered by tests
log_context.stacks.append({"component": "llm_handler", "data": data})
return resp
10 changes: 4 additions & 6 deletions application/agents/classic_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@
):
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(

Check warning on line 55 in application/agents/classic_agent.py

View check run for this annotation

Codecov / codecov/patch

application/agents/classic_agent.py#L55

Added line #L55 was not covered by tests
{"component": "agent", "data": {"tool_calls": self.tool_calls.copy()}}
)

yield {"sources": retrieved_data}
yield {"tool_calls": self.tool_calls.copy()}
4 changes: 4 additions & 0 deletions application/agents/react_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
if isinstance(line, str):
self.observations.append(line)

log_context.stacks.append(

Check warning on line 85 in application/agents/react_agent.py

View check run for this annotation

Codecov / codecov/patch

application/agents/react_agent.py#L85

Added line #L85 was not covered by tests
{"component": "agent", "data": {"tool_calls": self.tool_calls.copy()}}
)

yield {"sources": retrieved_data}
yield {"tool_calls": self.tool_calls.copy()}

Expand Down
Loading