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: add aprep_output method to langchain/chains/base.py #20748

Merged

Conversation

hslee16
Copy link
Contributor

@hslee16 hslee16 commented Apr 22, 2024

Description

Add aprep_output method to langchain/chains/base.py. Some downstream ChatMessageHistory objects that use async connections require an async way to append to the context.

It turned out that ainvoke() was calling prep_output which is synchronous.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 22, 2024
Copy link

vercel bot commented Apr 22, 2024

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 Apr 24, 2024 10:14pm

@dosubot dosubot bot added the 🤖:improvement Medium size change to existing code to handle new use-cases label Apr 22, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Apr 24, 2024
@baskaryan baskaryan enabled auto-merge (squash) April 24, 2024 22:14
@baskaryan baskaryan merged commit 243ba71 into langchain-ai:master Apr 24, 2024
42 checks passed
@hslee16 hslee16 deleted the add_aprep_outputs_to_chain_base branch April 24, 2024 23:19
hinthornw pushed a commit that referenced this pull request Apr 26, 2024
….py` (#20748)

## Description

Add `aprep_output` method to `langchain/chains/base.py`. Some downstream
`ChatMessageHistory` objects that use async connections require an async
way to append to the context.

It turned out that `ainvoke()` was calling `prep_output` which is
synchronous.

---------

Co-authored-by: Bagatur <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases lgtm PR looks good. Use to confirm that a PR is ready for merging. size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants