Skip to content

Commit 64e666c

Browse files
HaystackBotsjrl
andauthored
docs: sync Haystack API reference on Docusaurus (#12029)
Co-authored-by: sjrl <10526848+sjrl@users.noreply.github.com>
1 parent 2e6f473 commit 64e666c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docs-website/reference/haystack-api/agents_api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ agent = Agent(
101101
user_prompt="""{% message role="user"%}
102102
Translate the following document to {{ language }}: {{ document }}
103103
{% endmessage %}""",
104-
required_variables=["language", "document"],
105104
)
106105

107106
# The template variables 'language' and 'document' become inputs to the run method
@@ -172,7 +171,7 @@ __init__(
172171
tools: ToolsType | None = None,
173172
system_prompt: str | None = None,
174173
user_prompt: str | None = None,
175-
required_variables: list[str] | Literal["*"] | None = None,
174+
required_variables: list[str] | Literal["*"] | None = "*",
176175
exit_conditions: list[str] | None = None,
177176
state_schema: dict[str, Any] | None = None,
178177
max_agent_steps: int = 100,
@@ -199,7 +198,8 @@ Initialize the agent component.
199198
[documentation](https://docs.haystack.deepset.ai/docs/chatpromptbuilder#string-templates).
200199
- **required_variables** (<code>list\[str\] | Literal['\*'] | None</code>) – Lists the variables that must be provided as inputs to `user_prompt` or `system_prompt`.
201200
If a required variable is not provided at run time, an exception is raised.
202-
If set to `"*"`, all variables found in the prompts are required. Optional.
201+
If set to `"*"`, all variables found in the prompts are required. Defaults to `"*"`.
202+
Set to `None` to make all variables optional; missing ones render as empty strings.
203203
- **exit_conditions** (<code>list\[str\] | None</code>) – List of conditions that will cause the agent to return.
204204
Can include "text" if the agent should return when it generates a message without tool calls,
205205
or tool names that will cause the agent to return once the tool was executed. Defaults to ["text"].

0 commit comments

Comments
 (0)