Skip to content

Commit

Permalink
correct type hinting since fn is now a generator
Browse files Browse the repository at this point in the history
  • Loading branch information
clefourrier committed Jan 21, 2025
1 parent ff258fc commit 5bd4361
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/smolagents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def run(
# We only want the last step and want to go through the generator efficiently
return deque(self._run(task=self.task), maxlen=1)[0]

def _run(self, task: str) -> Union[str, Generator[str, None, None]]:
def _run(self, task: str) -> Generator[str, None, None]:
"""
Runs the agent. Running can be done in direct or streaming mode.
Note: in all cases, this function is internal and should be used only in the `run` method.
Expand Down

0 comments on commit 5bd4361

Please sign in to comment.