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

Add support langchain stream #495

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wodadehencou
Copy link
Contributor

When calling the stream method in LangChain, the on_chain_start method takes a dummy input: {"input":""}. This is because if the input is a streaming data, it needs to collect all the streaming data completely before executing the update operation in the on_chain_end or on_chain_error callback methods.

In the on_chain_end and on_chain_error methods, when determining if the input kwargs has the inputs parameter, if it does, the inputs parameter is passed during the update trace execution to achieve the effect of updating the span's input.

The same issue is in langchain repo: langchain-ai/langchain#18567

When calling the stream method in LangChain, the on_chain_start method takes a dummy input: {"input":""}. This is because if the input is a streaming data, it needs to collect all the streaming data completely before executing the update operation in the on_chain_end or on_chain_error callback methods.

In the on_chain_end and on_chain_error methods, when determining if the input kwargs has the inputs parameter, if it does, the inputs parameter is passed during the update trace execution to achieve the effect of updating the span's input.
@CLAassistant
Copy link

CLAassistant commented Mar 19, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants