mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-28 10:39:23 +00:00
Fixed OpenAIFunctionsAgent not returning when receiving AgentFinish (#14236)
**Description:** The way the condition is checked in the `return_stopped_response` function of `OpenAIAgent` may not be correct, when the value returned is `AgentFinish` from the tools it does not work properly. Thanks for review, @baskaryan, @eyurtsev, @hwchase17.
This commit is contained in:
parent
6826feea14
commit
ca8a022cd9
@ -162,7 +162,7 @@ class OpenAIFunctionsAgent(BaseSingleActionAgent):
|
||||
agent_decision = self.plan(
|
||||
intermediate_steps, with_functions=False, **kwargs
|
||||
)
|
||||
if type(agent_decision) == AgentFinish:
|
||||
if isinstance(agent_decision, AgentFinish):
|
||||
return agent_decision
|
||||
else:
|
||||
raise ValueError(
|
||||
|
Loading…
Reference in New Issue
Block a user