How can I inject custom state schema or config schema? #7

Open
opened 2026-02-16 00:19:43 -05:00 by yindo · 0 comments
Owner

Originally created by @abrace-tech on GitHub (Jul 5, 2025).

I'm trying to use bigtool with tools that require access to the state and config, e.g., with signatures like:

@tool(
    "get_weather",
    description="Get the weather for a given city",
)
def get_weather(
    tool_call_id: Annotated[str, InjectedToolCallId],
    city: str,
    *,
    state: Annotated[StateSchema, InjectedState],
    config: Annotated[RunnableConfig, InjectedToolArg],
) -> str:
    """Get the weather for a given city."""
    ...

I don't currently see a way to inject the state schema or config schema into the create_agent function, like is possible in create_react_agent and for langgraph-supervisor create_supervisor. Is this feature planned? Any advice on how it could be implemented? Thanks!

Originally created by @abrace-tech on GitHub (Jul 5, 2025). I'm trying to use bigtool with tools that require access to the state and config, e.g., with signatures like: ```python @tool( "get_weather", description="Get the weather for a given city", ) def get_weather( tool_call_id: Annotated[str, InjectedToolCallId], city: str, *, state: Annotated[StateSchema, InjectedState], config: Annotated[RunnableConfig, InjectedToolArg], ) -> str: """Get the weather for a given city.""" ... ``` I don't currently see a way to inject the state schema or config schema into the `create_agent` function, like is possible in `create_react_agent` and for langgraph-supervisor `create_supervisor`. Is this feature planned? Any advice on how it could be implemented? Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph-bigtool#7