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

langchain: Make OutputFixingParser.from_llm() create a useable retry chain #24687

Merged
merged 6 commits into from
Jul 26, 2024

Conversation

scribu
Copy link
Contributor

@scribu scribu commented Jul 25, 2024

Description: OutputFixingParser.from_llm() creates a retry chain that returns a Generation instance, when it should actually just return a string.
Issue: #24600
Twitter handle: scribu

Copy link

vercel bot commented Jul 25, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 8:19pm

@scribu scribu force-pushed the output-fixing-parser-retry-chain branch from 7e6592e to a49b545 Compare July 25, 2024 20:59
@scribu scribu force-pushed the output-fixing-parser-retry-chain branch from 4dee48c to 11f14be Compare July 25, 2024 21:48
@scribu scribu marked this pull request as ready for review July 25, 2024 21:48
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 25, 2024
@dosubot dosubot bot added langchain Related to the langchain package Ɑ: parsing Related to output parser module 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Jul 25, 2024
@isahers1 isahers1 self-assigned this Jul 26, 2024
@eyurtsev eyurtsev self-requested a review July 26, 2024 02:37
@scribu
Copy link
Contributor Author

scribu commented Jul 26, 2024

There's a remaining lint error:

tests/unit_tests/output_parsers/test_fix.py:75: error: Argument "llm" to "from_llm" of "OutputFixingParser" has incompatible type "RunnableLambda[str, AIMessage]"; expected "BaseLanguageModel[Any]"

Not sure what the best way to fix it would be.

@scribu scribu force-pushed the output-fixing-parser-retry-chain branch from 69482dc to 2c9db0d Compare July 26, 2024 09:06
@scribu
Copy link
Contributor Author

scribu commented Jul 26, 2024

Fixed all linting errors now.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 26, 2024
@isahers1 isahers1 merged commit 174e7d2 into langchain-ai:master Jul 26, 2024
53 checks passed
@scribu scribu deleted the output-fixing-parser-retry-chain branch July 27, 2024 13:27
ccurme pushed a commit that referenced this pull request Aug 5, 2024
…t retry chain (#25053)

Description: RetryWithErrorOutputParser.from_llm() creates a retry chain
that returns a Generation instance, when it should actually just return
a string.
This class was forgotten when fixing the issue in PR #24687
olgamurraft pushed a commit to olgamurraft/langchain that referenced this pull request Aug 16, 2024
…chain (langchain-ai#24687)

Description: OutputFixingParser.from_llm() creates a retry chain that
returns a Generation instance, when it should actually just return a
string.
Issue: langchain-ai#24600
Twitter handle: scribu

---------

Co-authored-by: isaac hershenson <ihershenson@hmc.edu>
olgamurraft pushed a commit to olgamurraft/langchain that referenced this pull request Aug 16, 2024
…t retry chain (langchain-ai#25053)

Description: RetryWithErrorOutputParser.from_llm() creates a retry chain
that returns a Generation instance, when it should actually just return
a string.
This class was forgotten when fixing the issue in PR langchain-ai#24687
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 langchain Related to the langchain package Ɑ: parsing Related to output parser module size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants