Skip to content

Commit

Permalink
Fixed OpenAIFunctionsAgent not returning when receiving AgentFinish (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
lh0x00 committed Dec 4, 2023
1 parent 6826fee commit ca8a022
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def return_stopped_response(
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(
Expand Down

0 comments on commit ca8a022

Please sign in to comment.