-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
Issue: value error in BooleanOutputParser #5396
Comments
…the class BooleanOutputParser (#5397) when the LLMs output 'yes|no',BooleanOutputParser can parse it to 'True|False', fix the ValueError in parse(). <!-- when use the BooleanOutputParser in the chain_filter.py, the LLMs output 'yes|no',the function 'parse' will throw ValueError。 --> Fixes # (issue) #5396 #5396 --------- Co-authored-by: gaofeng27692 <gaofeng27692@hundsun.com>
…the class BooleanOutputParser (#5397) when the LLMs output 'yes|no',BooleanOutputParser can parse it to 'True|False', fix the ValueError in parse(). <!-- when use the BooleanOutputParser in the chain_filter.py, the LLMs output 'yes|no',the function 'parse' will throw ValueError。 --> Fixes # (issue) #5396 #5396 --------- Co-authored-by: gaofeng27692 <gaofeng27692@hundsun.com>
…the class BooleanOutputParser (langchain-ai#5397) when the LLMs output 'yes|no',BooleanOutputParser can parse it to 'True|False', fix the ValueError in parse(). <!-- when use the BooleanOutputParser in the chain_filter.py, the LLMs output 'yes|no',the function 'parse' will throw ValueError。 --> Fixes # (issue) langchain-ai#5396 langchain-ai#5396 --------- Co-authored-by: gaofeng27692 <gaofeng27692@hundsun.com>
Hi, @ARSblithe212! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale. From what I understand, you reported an issue regarding the BooleanOutputParser in chain_filter.py. It seems that when the LLMs output 'yes|no', a ValueError is thrown. The suggested fix is to modify the 'parse' function to check if the cleaned text is either the true value or the false value, and raise a ValueError if it is not. Since there hasn't been any activity on this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your understanding and contribution to the LangChain project! |
Issue you'd like to raise.
when use the BooleanOutputParser in the chain_filter.py, the LLMs output 'yes|no',the function 'parse' will throw ValueError。
Suggestion:
I fix it,as follows:
def parse(self, text: str) -> bool:
"""Parse the output of an LLM call to a boolean.
The text was updated successfully, but these errors were encountered: