Skip to content

Clarify how to filter final vs. intermediate generation events in streaming API #947

Open
@paulsengh

Description

@paulsengh

Streaming sends multiple generation events where output[].type == "message". Some of those events also include a "function_call" entry (tool step). I only want to show the final assistant reply, but right now there’s no obvious way to tell final vs. intermediate messages.

Is there a flag or stable pattern to identify the final generation event (i.e. ones without any tool calls)? If not, what’s the recommended workaround to filter out intermediate messages that accompany tool calls without waiting for the full message generation, as that defeats the purpose of streaming?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions