Skip to content

Commit

Permalink
Document returned value of MultiStepAgent.run()
Browse files Browse the repository at this point in the history
  • Loading branch information
cloderic authored Mar 5, 2025
1 parent ff7ba51 commit 820a096
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/smolagents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,17 @@ def run(
additional_args (`dict`, *optional*): Any other variables that you want to pass to the agent run, for instance images or dataframes. Give them clear names!
max_steps (`int`, *optional*): Maximum number of steps the agent can take to solve the task. if not provided, will use the agent's default value.
Returns:
If `stream` is False:
- The final answer to the task
If `stream` is True:
- The output of each step, as it is taken, as a Generator
Example:
```py
from smolagents import CodeAgent
agent = CodeAgent(tools=[])
agent.run("What is the result of 2 power 3.7384?")
final_answer = agent.run("What is the result of 2 power 3.7384?")
```
"""
max_steps = max_steps or self.max_steps
Expand Down

0 comments on commit 820a096

Please sign in to comment.