Repository navigation
Conversation
Preserve search support while tracing streamed answers, conversations, ranking and grounding. Keep response content opt-in with bounded privacy controls and lifecycle-safe stream proxies. Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
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.
What does this PR do?
Keep the Discovery Engine package and complete its v1 semantic operation coverage. Adds sync/async
stream_answer_query,converse_conversation,rankandcheck_groundingwithout removing the instrumentor entry point or existing search support.capture_content=Trueopts into a bounded, whitelisted response projection, including answer/citation/reference content and search/ranking/grounding results. Default output capture stays off. Either content-hide flag overrides capture, credential/PII scrubbing precedes truncation, and valid output JSON is bounded to 16 KiB. Errors from newly covered operations suppress server text that may echo private content.Why?
On unchanged dev
d6a9966dd4d5d5fb344f7f5ab11b7483c2c2a6bc, all seven initial regression cases fail because no operation span is exported (six sync/async unary cases and a real loopback gRPC answer stream). A generic transport span is not a replacement for semantic retrieval/answer/ranking/grounding observations.Coverage reference, inspected rather than copied: Braintrust's exact v1 targets at 3f14f10. Stream behavior follows Google's streamed-answer example, which emits text deltas followed by a complete terminal answer.
How was it tested?
google-cloud-discoveryengine==0.20.5,fi-instrumentation-otel==1.1.0(core floor).fi-instrumentation-otel==1.2.2(current registry core). Discovery Engine 0.20.5 is both the supported floor and current PyPI release; these are not claimed as two distinct SDK versions.sandbox-exec, permitting loopback only. The gRPC fixture uses native IPv6 loopback on macOS because its IPv4-mapped IPv6 sockets are denied by that policy; Linux keeps the existing IPv4 fixture.ruff --isolated --select E9,F) passes on baseline and changed implementation/new tests;git diff --checkpasses. Python snippets in README and staged guide parse.Review and rollout
Self-reviewed against internal minimal-code, contracts, failure-mode, typing and scenario-coverage standards. Existing public imports and call shapes remain supported. Search paging remains first-page-only; beta/alpha aliases and administrative RPCs remain deliberately excluded. The new stream proxy delegates vendor methods and adds deterministic close support; callers should exhaust or explicitly close a stream.
Target is dev, per this repair's release workflow (not the template's generic main default). This is a package repair, not a retirement. No merge, tag or publication is performed here.
The existing docs proposal is docs #1019; it covers the older three-operation package. A corrected full guide is staged for its owner after this package reaches PyPI. No competing docs PR is opened and no other author's branch is modified.
Generated with Claude Code