Skip to content

Conversation

@mjnovice
Copy link

No description provided.

Comment on lines +66 to +77
if isinstance(last_message.content, list):
# Filter out control flow tools from content as well
filtered_ids = {tc["id"] for tc in filtered_tool_calls}
filtered_content = [
item
for item in last_message.content
if not (
isinstance(item, dict)
and item.get("type") == "function_call"
and item.get("call_id") not in filtered_ids
)
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this only works for OpenAPI

Comment on lines +74 to +78
# Create temporary state with the response to filter tool calls
temp_state = AgentGraphState(
messages=[*messages, response],
inner_state=state.inner_state,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the temp state?

Comment on lines +57 to +58
from .router import filter_control_flow_tool_calls_from_state

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally not the biggest fan of scoped imports, but that's just me.
I'd also move that utility function somewhere else, since llm_node importing from router feels weird if you think about separating concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants