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

fix(remote): use "messages-tuple" when requesting "messages" #799

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions libs/langgraph/src/pregel/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,12 @@ const getStreamModes = (
(typeof streamMode === "string" ||
(Array.isArray(streamMode) && streamMode.length > 0))
) {
if (typeof streamMode === "string") {
updatedStreamModes.push(streamMode);
} else {
reqSingle = false;
updatedStreamModes.push(...streamMode);
}
reqSingle = typeof streamMode === "string";
const mapped = Array.isArray(streamMode) ? streamMode : [streamMode];
updatedStreamModes.push(...mapped);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is equivalent to what was there before right?

} else {
updatedStreamModes.push(defaultStreamMode);
}
// TODO: Map messages to messages-tuple
if (updatedStreamModes.includes("updates")) {
reqUpdates = true;
} else {
Expand Down Expand Up @@ -412,7 +408,10 @@ export class RemoteGraph<
...updatedStreamModes,
...(streamProtocolInstance?.modes ?? new Set()),
]),
];
].map((mode) => {
if (mode === "messages") return "messages-tuple";
return mode;
});

let command;
let serializedInput;
Expand Down
Loading