Skip to content

feat(google_genai): trace interactions api methods#210

Merged
Abhijeet Prasad (AbhiPrasad) merged 4 commits into
mainfrom
abhi-feat-198-google-genai-interactions
Apr 8, 2026
Merged

feat(google_genai): trace interactions api methods#210
Abhijeet Prasad (AbhiPrasad) merged 4 commits into
mainfrom
abhi-feat-198-google-genai-interactions

Conversation

@AbhiPrasad
Copy link
Copy Markdown
Member

Instrument the Google GenAI Interactions API for sync and async create, get, cancel, delete, and streaming calls. The new tracing normalizes interaction inputs and outputs, records usage and timing, tracks previous_interaction_id, and emits nested tool spans for interaction tool calls.

Replace the earlier fake-based interaction coverage with VCR-backed integration tests and recorded cassettes so the span shape is validated against real SDK behavior.

Closes #198

Instrument the Google GenAI Interactions API for sync and async create,
get, cancel, delete, and streaming calls. The new tracing
normalizes interaction inputs and outputs, records usage and timing,
tracks previous_interaction_id, and emits nested tool spans for
interaction tool calls.

Replace the earlier fake-based interaction coverage with VCR-backed
integration tests and recorded cassettes so the span shape is
validated against real SDK behavior.

Closes #198
@starfolkai
Copy link
Copy Markdown
Contributor

starfolkai Bot commented Apr 7, 2026

Drop into this review session: sfk devbox connect pr-210-braintrust-sdk-python-1922 --attach

No serious bugs or issues found 🎉

}
)

with start_span(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be a dumb question but I am wondering whether we are properly nesting things inside the tool calls within the tool span here? Also are we properly recording start/end timestamps with this?

…ions

The interactions API was introduced in google-genai 1.55.0. The test
file imported google.genai.interactions unconditionally at module level,
which caused collection to fail on google-genai 1.30.0 (the minimum
pinned version in noxfile.py).

Make the import conditional and add a skipif marker so the seven
interaction tests are gracefully skipped when running against older
SDK versions.
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) merged commit 33dad48 into main Apr 8, 2026
39 checks passed
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) deleted the abhi-feat-198-google-genai-interactions branch April 8, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOT ISSUE] Google GenAI: Interactions API not instrumented

2 participants