Skip to content
Merged
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
3 changes: 3 additions & 0 deletions trpc_agent_sdk/tools/_agent_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ async def _run_async_impl(
) -> Any:
try:
from trpc_agent_sdk.agents import LlmAgent
from trpc_agent_sdk.dsl.graph import GraphAgent, STATE_KEY_LAST_RESPONSE
if self.skip_summarization:
tool_context.event_actions.skip_summarization = True
if isinstance(self.agent, LlmAgent) and self.agent.input_schema:
Expand Down Expand Up @@ -206,6 +207,8 @@ async def _run_async_impl(
merged_text = '\n'.join([p.text for p in last_event.content.parts if p.text])
repaired = json_repair_string(merged_text)
tool_result = self.agent.output_schema.model_validate_json(repaired).model_dump(exclude_none=True)
elif isinstance(self.agent, GraphAgent):
tool_result = tool_context.state.get(STATE_KEY_LAST_RESPONSE, '')
else:
tool_result = '\n'.join([p.text for p in last_event.content.parts if p.text])
return tool_result
Expand Down
Loading