-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(langgraph): add custom stream mode support in LangChain LLMAdapter #4511
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
base: main
Are you sure you want to change the base?
Conversation
Extend _to_chat_chunk to handle StreamWriter output types (dict, objects with content attr) so both "messages" and "custom" modes use the same conversion function. The difference is that "messages" mode data goes through _extract_message_chunk first to unwrap (token, meta) tuples, while "custom" mode data from StreamWriter is passed directly.")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b0639d783
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
livekit-plugins/livekit-plugins-langchain/livekit/plugins/langchain/langgraph.py
Outdated
Show resolved
Hide resolved
- Expand StreamMode type to include all modes to satisfy type checker. - Add runtime validation to raise ValueError for unsupported modes
Add explicit handling for single-mode "custom"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6eb8409988
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
livekit-plugins/livekit-plugins-langchain/livekit/plugins/langchain/langgraph.py
Show resolved
Hide resolved
|
@davidzhao I saw you’ve reviewed related pr #3112 before. |
Langgraph not only supports messages streams but also custom. And it is only way to modify what to stream in livekit-langgraph integration.
So for that,
stream_modeparameter supporting"messages"and"custom"modes_to_chat_chunk()to handle dict and object inputs