-
Notifications
You must be signed in to change notification settings - Fork 15.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Harrison/improved retry tool #4842
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the notebook example!
langchain/agents/agent.py
Outdated
@@ -625,7 +625,7 @@ class AgentExecutor(Chain): | |||
max_iterations: Optional[int] = 15 | |||
max_execution_time: Optional[float] = None | |||
early_stopping_method: str = "force" | |||
handle_parsing_errors: bool = False | |||
handle_parsing_errors: Union[bool, str, Callable] = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we enforce the callable must return a string?
langchain/agents/agent.py
Outdated
elif isinstance(self.handle_parsing_errors, str): | ||
observation = self.handle_parsing_errors | ||
elif callable(self.handle_parsing_errors): | ||
observation = self.handle_parsing_errors(text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's more flexible to pass in the original exception, or just the string form of it?
No description provided.