Skip to content

[FEATURE] Allow users to pass arbitrary agent args as part of the agent_graph tool #324

Open
@GodlikePenguin

Description

@GodlikePenguin

Problem Statement

Currently when using the agent_graph tool, you don't have full control over what parameters are passed to the use_llm tool call to evaluate your graph. This is problematic as the default callback_handler prints the agent output to stdout. If you have a graph with multiple concurrent ages this leads to colliding output on stdout and the results are unreadable. I would like to be able to override the parameters sent to the use_llm call such that I am in control over each agent's configuration.

Proposed Solution

The agent_graph function does take kwargs, from which some values are added to tool_context which is eventually passed to the use_llm function, however since we don't take all values from kwargs, just the known ones, then I can't override arbitrary parameters with this. A naive solution would be to pass all of kwargs to tool_context.

However, this doesn't work nicely if you want different agents to have different parameters. This feels like this would have to be assigned as part of the graph topology, but it's a larger change.

Use Case

agent_graph is almost unusable from a stdout perspective without this change.

Alternatives Solutions

I may be able to hack this by interacting directly with the _MANAGER variable in the agent_graph file, but this feels flimsy.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions