Repository navigation
Stream Google Interactions over POST and surface reasoning, tool calls and sources - #717
Conversation
…s and sources Non-background doStream waited for the whole response and emitted it as one text delta. It now posts with stream: true and pipes the event stream, like upstream. The transform also emits reasoning, function calls, built-in tool calls and results, sources, and processing steps as custom parts, and falls back to the x-gemini-service-tier header for the service tier. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQmtUKfZTs497KkiGSfYk9
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQmtUKfZTs497KkiGSfYk9
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@coderabbitai review |
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
GoogleInteractionsModel.DoStreamAsyncused to wait for the whole response and emit it as one text delta. It now posts withstream: trueand pipes the event stream, like upstream. The stream transform also surfaces reasoning (with its signature), client function calls, built-in tool calls and results, sources, andgoogle.processing_*custom parts. Sources come fromtext_annotationdeltas and built-in tool results, and each URL or file appears once. The service tier falls back to thex-gemini-service-tierheader wheninteraction.completedhas none.No new public types.
.NET-only symbols, all internal or private:
GoogleInteractionsSourcesis a container for upstream's three exported functionsannotationToSource,annotationsToSourcesandbuiltinToolResultToSources(extract-google-interactions-sources.ts). C# has no free functions, so they need a static class. ItsKeymethod is upstream's localsourceKeyinbuild-google-interactions-stream-transform.ts, moved here so the transform and the extractor share one rule.GoogleInteractionsStreamTransform.NonEmptyandStripreplace the JS||fallback andString.replace(/_call$/, '')in the same transform.ResponseHeadersproperty on the testSequencedHandlerand a stream snapshot helper.Part of #692.
Not ported
buildGoogleInteractionsStreamTransform — video deltas:FileStreamPartcarries bytes only, so aurioutput cannot be streamed. Needs a design call.buildGoogleInteractionsStreamTransform — usage modality:outputTokensByModalityis not ported.GoogleInteractionsLanguageModel.doStream > service tier::sends service_tier in the request body when providerOptions.google.serviceTier is set: the request does not sendservice_tieryet.GoogleInteractionsLanguageModel.doStream::serializes video response format controls and streams inline video dataGoogleInteractionsLanguageModel.doStream > stateful chaining (multi-turn fixtures)GoogleInteractionsLanguageModel.doStream > stateless multi-turn (store: false, no previousInteractionId)GoogleInteractionsLanguageModel.doStream > image outputGoogleInteractionsLanguageModel.doStream > agent factory branchGoogleInteractionsLanguageModel agent polling: the two file-part tests.The doStream tool tests pass tools upstream; the port does not send Interactions tools yet, and the stream output does not depend on them.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TQmtUKfZTs497KkiGSfYk9
Summary by CodeRabbit
New Features
Documentation