Skip to content
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

Don't throw JSON decode error in OpenAIFunctionsAgent #8070

Closed

Conversation

chris-boson
Copy link

@chris-boson chris-boson commented Jul 21, 2023

related to https://github.com/appfolio/af_reactor/issues/1438

Expected behavior

For a BaseTool the OpenAIFunctionCallingAgent reliably outputs a response of the form

{"name": "<tool_name>", "arguments": {"__arg1": "<tool_input>"}}

Actual behavior

For some inputs it formats the response as

{"name": "<tool_name>", "arguments": "<tool_input>"}

which leads to a JSONDecodeError. The agent doesn't seem to follow the "hacky" format very reliably, even when explicitly encouraged in the system prompt.

@hinthornw

@vercel
Copy link

vercel bot commented Jul 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Jul 21, 2023 1:08pm

@dosubot dosubot bot added Ɑ: agent Related to agents module 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Jul 21, 2023
@chris-boson chris-boson marked this pull request as draft July 21, 2023 13:04
@chris-boson chris-boson marked this pull request as ready for review July 21, 2023 13:10
@hwchase17
Copy link
Contributor

I don't think this is general enough to land

I think a better solution would be to make it easier to customize this parsing

@hwchase17 hwchase17 closed this Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: agent Related to agents module 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants