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

Reduce the number of LLM parsing error with conversational chats #7575

Closed
wants to merge 1 commit into from

Conversation

lesser-panda
Copy link

@lesser-panda lesser-panda commented Jul 12, 2023

A lot of times, when the LLM responses a Final Answer with markdown in the answer text (e.g. asking the LLM to write some code), the parser raises an OutputParserException("Could not parse LLM output: ..."), when the answer from the LLM is totally acceptable.

This change should reduce the number of such occurances.

For example, this response from gpt-turbo-3.5 for "How to convert a list of dict to a JSON in Python" seems totally acceptable as the final answer, but will raise the OutputParserException, even with handle_parsing_errors=True. This PR fixes it.
Screenshot 2023-07-12 101547

@vercel
Copy link

vercel bot commented Jul 12, 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) Visit Preview Jul 31, 2023 1:05am

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Jul 12, 2023
@lesser-panda
Copy link
Author

I understand this is probably not the most elegant solution, so any suggestions are welcomed!

@lesser-panda lesser-panda reopened this Jul 31, 2023
@R0315
Copy link

R0315 commented Aug 1, 2023

I'm currently facing this parsing issue problem and i tried appling this solution but i'm just getting the below output rather than the actual answer. I asked it to write a python function that adds two numbers together (which I was doing as a test to see if the bot worked and kept getting the parsing error).

{ "action": "Final Answer", "action_input": "Sure! Here's a Python function that adds two numbers together:\n\npython\ndef add_numbers(a, b):\n return a + b\n" }

@hwchase17 hwchase17 closed this Jan 30, 2024
@baskaryan baskaryan reopened this Jan 30, 2024
@nfcampos
Copy link
Collaborator

Thanks, no longer relevant, I suggest using an agent with tool-calling

@nfcampos nfcampos closed this Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖: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.

5 participants