-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Can we get only chunk message without metadata on stream mode of "messages_tuple"? #3143
Replies: 1 comment · 2 replies
-
Streaming metadata is actually intended and important for a lot of use cases (for example, filtering streamed tokens from a particular model invocation, etc) If you don't need the metadata, you can simply unpack the data in the loop and only keep the message async for chunk in client.runs.stream(
thread["thread_id"],
assistant_id=assistant_id,
input=input,
config=config,
stream_mode="messages-tuple",
):
print(chunk.data[0]) # ignore metadata also, not sure what you mean by "property of null" |
Beta Was this translation helpful? Give feedback.
All reactions
-
I mean I am receiving streaming data from UI(browser level) below is example streaming data receiving (this is just piece of lines grabbed)
|
Beta Was this translation helpful? Give feedback.
All reactions
-
I am also facing same issue. I am using https://langchain-ai.github.io/langgraph/cloud/how-tos/use_stream_react/ and there is not way to filter. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I was testing "messages_tuple" as stream_mode since I like chunk message receiving instead of completed message like "messages".
However it returns with metadata together which is unnecessary.
Is there away to receive only chunk message without metadata? also can we remove property of null or empty list ?
This will reduce duplicated streaming data a lot.
Beta Was this translation helpful? Give feedback.
All reactions