You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**agent** (<code>Agent</code>) – The Haystack Agent to wrap as a tool.
95
+
-**name** (<code>str</code>) – Name of the tool.
96
+
-**description** (<code>str</code>) – Description of the tool. It should tell the calling LLM what the Agent is specialized in
97
+
and when to delegate to it.
98
+
-**parameters** (<code>dict\[str, Any\] | None</code>) – A JSON schema defining the parameters expected by the Tool.
99
+
Will fall back to a schema with the task to delegate as a single user message, plus one string parameter
100
+
for every other mandatory input of the Agent, if not provided.
101
+
-**outputs_to_string** (<code>dict\[str, str | Callable\\[[Any\], str\]\] | None</code>) – Optional dictionary defining how tool outputs should be converted into string(s) or results.
102
+
If not provided, the tool result is the text of the Agent's final reply, or the serialized message if
103
+
the reply has no text. A warning is appended if the Agent stopped because it reached `max_agent_steps`.
104
+
105
+
`outputs_to_string` supports two formats:
106
+
107
+
1. Single output format - use "source", "handler", and/or "raw_result" at the root level:
Each key maps to a dictionary that can contain "source" and/or "handler".
133
+
Note that `raw_result` is not supported in the multiple output format.
134
+
135
+
-**inputs_from_state** (<code>dict\[str, str\] | None</code>) – Optional dictionary mapping the calling Agent's state keys to Agent input names.
136
+
Example: `{"subject": "topic"}` maps state's "subject" to the Agent's "topic" input.
137
+
Inputs mapped this way are not added to the generated `parameters` schema, since the calling Agent
138
+
provides them.
139
+
-**outputs_to_state** (<code>dict\[str, dict\[str, str | Callable\]\] | None</code>) – Optional dictionary defining how tool outputs map to keys within state as well as optional handlers.
140
+
The keys must be declared in the `state_schema` of the calling Agent.
141
+
Handlers merge the tool output into the state and are called as `handler(current_value, tool_output)`.
142
+
If the source is provided only the specified output key is sent to the handler.
0 commit comments