fix: accept metadata-only SSE chunks instead of aborting stream in StreamingResponseAggregator#918
Merged
Merged
Conversation
…amingResponseAggregator ## Link to Issue or Description of Change Signed-off-by: anish k <ak8686@princeton.edu>
Collaborator
Author
|
Manual tests: func main() {
ctx := context.Background()
model, err := gemini.NewModel(ctx, "gemini-3.1-flash-lite", &genai.ClientConfig{
Backend: genai.BackendVertexAI,
Project: "PROJECT",
Location: "global",
})
if err != nil {
log.Fatalf("Failed to create model: %v", err)
}
a, err := llmagent.New(llmagent.Config{
Name: "weather_time_agent",
Model: model,
Description: "Helpful Agent",
Instruction: "Your purpose is to help the user by using search tool.",
Tools: []tool.Tool{
geminitool.GoogleSearch{},
},
})
if err != nil {
log.Fatalf("Failed to create agent: %v", err)
}
config := &launcher.Config{
AgentLoader: agent.NewSingleLoader(a),
}
l := full.NewLauncher()
if err = l.Execute(ctx, config, os.Args[1:]); err != nil {
log.Fatalf("Run failed: %v\n\n%s", err, l.CommandLineSyntax())
}
}Execute: echo "What are some recent movie recommendations?" | go run ./examples/quickstart/main.go --streaming_mode sse
|
Collaborator
Author
|
@anishesg , please be aware, basing on your PR I have created a new one (with your contributions included), solving the issue in a different way. |
wolo-lab
approved these changes
May 29, 2026
Closed
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modified version of #783
Instead of ignoring the SSE chunks with no candidates, this version accepts them and passes them downstream to further processing (they contain usageMetadata)