You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖:bugRelated to a bug, vulnerability, unexpected error with an existing featureⱭ: modelsRelated to LLMs or chat model modules🔌: openaiPrimarily related to OpenAI integrations
When streaming via langchain_openai.llms.base.BaseOpenAI._stream the yield appears before triggering the run manager event. This makes it impossible to invoke on_llm_new_token methods in a callback until the full response is received.
System Info
System Information
------------------
> OS: Linux
> OS Version: #21~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 9 13:32:52 UTC 2
> Python Version: 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0]
Package Information
-------------------
> langchain_core: 0.1.30
> langchain: 0.1.11
> langchain_community: 0.0.27
> langsmith: 0.1.23
> langchain_openai: 0.0.8
> langchain_text_splitters: 0.0.1
Packages not installed (Not Necessarily a Problem)
--------------------------------------------------
The following packages were not found:
> langgraph
> langserve
The text was updated successfully, but these errors were encountered:
dosubotbot
added
Ɑ: models
Related to LLMs or chat model modules
🔌: openai
Primarily related to OpenAI integrations
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
labels
Mar 16, 2024
Additionally, it would be good to pass stream_resp to the callback as well. This would allow clients to differentiate between multiple responses when n > 1. For example:
the problem of yielding before calling the run manager has been fixed by #18269. (I don't know enough to comment on the other enhancement you proposed)
dosubotbot
added
the
stale
Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed
label
Jun 22, 2024
🤖:bugRelated to a bug, vulnerability, unexpected error with an existing featureⱭ: modelsRelated to LLMs or chat model modules🔌: openaiPrimarily related to OpenAI integrations
Checked other resources
Example Code
Current implementation:
I believe this would correct and produce the intended behavior:
Error Message and Stack Trace (if applicable)
No response
Description
When streaming via
langchain_openai.llms.base.BaseOpenAI._stream
the yield appears before triggering the run manager event. This makes it impossible to invokeon_llm_new_token
methods in a callback until the full response is received.System Info
The text was updated successfully, but these errors were encountered: