Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .agents/skills/sdk-integrations/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ Only emit spec-listed keys:
- `prompt_audio_tokens`, `completion_audio_tokens`, `completion_image_tokens` — audio/image models when provider reports
- `start`, `end` — standard span timing

Map provider modality breakdowns only to standardized metrics: input audio → `prompt_audio_tokens`, output audio → `completion_audio_tokens`, and output image → `completion_image_tokens`. These are subsets of prompt/completion usage, not additional tokens. Preserve unstandardized modality breakdowns as deliberately named provider metadata rather than inventing metric keys.

For streaming, still produce one span per API call with accumulated `input`/`output`. Capture usage from stream metadata (e.g. OpenAI `stream_options.include_usage`) when surfaced.

For reasoning models, capture the full output structure (reasoning summaries + message blocks) and include prior reasoning in `input` for multi-turn calls.
Expand Down Expand Up @@ -261,7 +263,7 @@ Assert on emitted spans (not just provider return values):

For streaming, assert both the provider iterator/async-iterator still works AND the final span has aggregated `output` + stream-specific `metrics`.

Cassettes live in `integrations/<provider>/cassettes/<version>/` (e.g. `cassettes/latest/`, `cassettes/0.48.0/`). Nox sets `BRAINTRUST_TEST_PACKAGE_VERSION` so cassettes land correctly. Do not add per-test `vcr_cassette_dir` / `cassette_library_dir` fixtures — `integrations/conftest.py` handles it. Re-record only when behavior intentionally changed. Sanitize cassettes when the provider returns binary bodies.
Cassettes live in `integrations/<provider>/cassettes/<version>/` (e.g. `cassettes/latest/`, `cassettes/0.48.0/`). Nox sets `BRAINTRUST_TEST_PACKAGE_VERSION` so cassettes land correctly. Do not add per-test `vcr_cassette_dir` / `cassette_library_dir` fixtures — `integrations/conftest.py` handles it. Re-record only when behavior intentionally changed. Sanitize binary media in both request and response bodies so checked-in cassettes do not retain large base64 payloads.

Confirm the exact session name from `noxfile.py` — don't assume it matches the folder.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
interactions:
- request:
body: '{"contents": [{"parts": [{"inlineData": {"data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQAAAAA=",
"mimeType": "audio/wav"}}, {"text": "Describe this audio in five words or less."}],
"role": "user"}], "generationConfig": {"maxOutputTokens": 100}}'
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- '42928'
content-type:
- application/json
host:
- generativelanguage.googleapis.com
user-agent:
- google-genai-sdk/2.14.0 gl-python/3.14.6
x-goog-api-client:
- google-genai-sdk/2.14.0 gl-python/3.14.6
method: POST
uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-lite:generateContent
response:
body:
string: "{\n \"candidates\": [\n {\n \"content\": {\n \"parts\":
[\n {\n \"text\": \"Relaxing acoustic guitar music.\"\n
\ }\n ],\n \"role\": \"model\"\n },\n \"finishReason\":
\"STOP\",\n \"index\": 0\n }\n ],\n \"usageMetadata\": {\n \"promptTokenCount\":
43,\n \"candidatesTokenCount\": 6,\n \"totalTokenCount\": 49,\n \"promptTokensDetails\":
[\n {\n \"modality\": \"TEXT\",\n \"tokenCount\": 10\n
\ },\n {\n \"modality\": \"AUDIO\",\n \"tokenCount\":
33\n }\n ],\n \"serviceTier\": \"standard\"\n },\n \"modelVersion\":
\"gemini-2.5-flash-lite\",\n \"responseId\": \"N1NqapHyDayQ-8YPkLLHgAo\"\n}\n"
headers:
alt-svc:
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
content-length:
- '649'
content-type:
- application/json; charset=UTF-8
date:
- Wed, 29 Jul 2026 19:23:36 GMT
server:
- scaffolding on HTTPServer2
server-timing:
- gfet4t7; dur=1155
transfer-encoding:
- chunked
vary:
- Origin
- X-Origin
- Referer
x-content-type-options:
- nosniff
x-frame-options:
- SAMEORIGIN
x-gemini-service-tier:
- standard
x-xss-protection:
- '0'
status:
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
interactions:
- request:
body: '{"model": "models/gemini-2.5-flash", "ttl": "300s", "displayName": "braintrust-google-genai-vcr-test",
"contents": [{"parts": [{"text": "The sky is blue because molecules scatter
blue light. The sky is blue because molecules scatter blue light. The sky is
blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. The sky is blue because molecules
scatter blue light. The sky is blue because molecules scatter blue light. The
sky is blue because molecules scatter blue light. "}], "role": "user"}]}'
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- '8259'
content-type:
- application/json
host:
- generativelanguage.googleapis.com
user-agent:
- google-genai-sdk/2.14.0 gl-python/3.14.6
x-goog-api-client:
- google-genai-sdk/2.14.0 gl-python/3.14.6
method: POST
uri: https://generativelanguage.googleapis.com/v1beta/cachedContents
response:
body:
string: "{\n \"name\": \"cachedContents/aixcv88yts91zirycnmno31aitdexjt7uc6b19mw\",\n
\ \"model\": \"models/gemini-2.5-flash\",\n \"createTime\": \"2026-07-29T19:15:22.193758Z\",\n
\ \"updateTime\": \"2026-07-29T19:15:22.193758Z\",\n \"expireTime\": \"2026-07-29T19:20:21.884570801Z\",\n
\ \"displayName\": \"braintrust-google-genai-vcr-test\",\n \"usageMetadata\":
{\n \"totalTokenCount\": 1502\n }\n}\n"
headers:
alt-svc:
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
content-length:
- '361'
content-type:
- application/json; charset=UTF-8
date:
- Wed, 29 Jul 2026 19:15:22 GMT
server:
- scaffolding on HTTPServer2
server-timing:
- gfet4t7; dur=591
transfer-encoding:
- chunked
vary:
- Origin
- X-Origin
- Referer
x-content-type-options:
- nosniff
x-frame-options:
- SAMEORIGIN
x-xss-protection:
- '0'
status:
code: 200
message: OK
- request:
body: '{"contents": [{"parts": [{"text": "In one sentence, why is the sky blue?"}],
"role": "user"}], "cachedContent": "cachedContents/aixcv88yts91zirycnmno31aitdexjt7uc6b19mw",
"generationConfig": {"maxOutputTokens": 100}}'
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- '216'
content-type:
- application/json
host:
- generativelanguage.googleapis.com
user-agent:
- google-genai-sdk/2.14.0 gl-python/3.14.6
x-goog-api-client:
- google-genai-sdk/2.14.0 gl-python/3.14.6
method: POST
uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
response:
body:
string: "{\n \"candidates\": [\n {\n \"content\": {\n \"parts\":
[\n {\n \"text\": \"The sky is blue because molecules
scatter blue light.\"\n }\n ],\n \"role\": \"model\"\n
\ },\n \"finishReason\": \"STOP\",\n \"index\": 0\n }\n ],\n
\ \"usageMetadata\": {\n \"promptTokenCount\": 1513,\n \"candidatesTokenCount\":
10,\n \"totalTokenCount\": 1595,\n \"cachedContentTokenCount\": 1502,\n
\ \"promptTokensDetails\": [\n {\n \"modality\": \"TEXT\",\n
\ \"tokenCount\": 1513\n }\n ],\n \"cacheTokensDetails\":
[\n {\n \"modality\": \"TEXT\",\n \"tokenCount\": 1502\n
\ }\n ],\n \"thoughtsTokenCount\": 72,\n \"serviceTier\": \"standard\"\n
\ },\n \"modelVersion\": \"gemini-2.5-flash\",\n \"responseId\": \"SlFqaqzJGYGr1MkP4cu4yQ0\"\n}\n"
headers:
alt-svc:
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
content-length:
- '775'
content-type:
- application/json; charset=UTF-8
date:
- Wed, 29 Jul 2026 19:15:23 GMT
server:
- scaffolding on HTTPServer2
server-timing:
- gfet4t7; dur=888
transfer-encoding:
- chunked
vary:
- Origin
- X-Origin
- Referer
x-content-type-options:
- nosniff
x-frame-options:
- SAMEORIGIN
x-gemini-service-tier:
- standard
x-xss-protection:
- '0'
status:
code: 200
message: OK
- request:
body: ''
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-type:
- application/json
host:
- generativelanguage.googleapis.com
user-agent:
- google-genai-sdk/2.14.0 gl-python/3.14.6
x-goog-api-client:
- google-genai-sdk/2.14.0 gl-python/3.14.6
method: DELETE
uri: https://generativelanguage.googleapis.com/v1beta/cachedContents/aixcv88yts91zirycnmno31aitdexjt7uc6b19mw
response:
body:
string: '{}

'
headers:
alt-svc:
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
content-length:
- '3'
content-type:
- application/json; charset=UTF-8
date:
- Wed, 29 Jul 2026 19:15:23 GMT
server:
- scaffolding on HTTPServer2
server-timing:
- gfet4t7; dur=120
transfer-encoding:
- chunked
vary:
- Origin
- X-Origin
- Referer
x-content-type-options:
- nosniff
x-frame-options:
- SAMEORIGIN
x-xss-protection:
- '0'
status:
code: 200
message: OK
version: 1
Loading