Skip to main content

Respan instrumentation plugin for Google Gen AI

Project description

respan-instrumentation-google-genai

Respan instrumentation plugin for the official Google Gen AI SDK.

The package patches google.genai.models.Models and AsyncModels generation methods and emits canonical Respan chat spans through the active OTEL pipeline. It captures sync calls, async calls, streaming calls, prompt and completion content, token usage, tool definitions, and model function calls.

Installation

pip install respan-ai respan-instrumentation-google-genai google-genai

Usage

from google import genai
from respan import Respan
from respan_instrumentation_google_genai import GoogleGenAIInstrumentor

respan = Respan(instrumentations=[GoogleGenAIInstrumentor()])
client = genai.Client()

response = client.models.generate_content(
    model="gemini-2.5-flash",
    contents="Say hello in three languages.",
)
print(response.text)
respan.flush()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

respan_instrumentation_google_genai-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file respan_instrumentation_google_genai-0.1.0.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_google_genai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 be7db2350dcbcba09fc815149c9645c5ec2db1301de104350766fea1c695d84c
MD5 df39e29d7607d47b0f3ef3ca5c9158b1
BLAKE2b-256 64238b7101f88ed5c4e921dd3ee21b60c9ffebe6186b003de939a8f38ee6b4d6

See more details on using hashes here.

File details

Details for the file respan_instrumentation_google_genai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for respan_instrumentation_google_genai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e2fd32914977505773cfa20ad2518795585a09504396d3e2e5a6f924dd4e82a
MD5 3581eaf155e684f80d059223b05739eb
BLAKE2b-256 54a404b33eefd0158f0fc7f36c05b48d4156dada6252c05e604771c43813e303

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page