-
Hi, I have two different classes in my Tool. One to control my Heres a simple idea: class FindCategory(BaseTool):
""""""
name: str = "find_category"
description: str = "Use this tool to find all available categories when needed."
args_schema: Type[MyModel] = MyModel
def _run(
self,
category_name: Optional[str],
state: Annotated[MyStateModel, InjectedState],
):
# my logic Now when I do: state = MyStateModel(messages=state.messages, ...)
await action.ainvoke(state) I get Now if I do: await action.ainvoke(input=state.messages, state=state) I get How am I supposed to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi - the state part needs to be defined in the args schema model (e.g. in |
Beta Was this translation helpful? Give feedback.
anything marked with
InjectedState
will be ignored by the LLM, so it's fine to put the state into your pydantic model arg schemae.g.