Metadata-Version: 2.4
Name: respan-instrumentation-google-genai
Version: 0.1.0
Summary: Respan instrumentation plugin for Google Gen AI
License: Apache 2.0
Author: Respan
Author-email: team@respan.ai
Requires-Python: >=3.11,<3.14
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: google-genai (>=1.0.0)
Requires-Dist: opentelemetry-semantic-conventions-ai (>=0.4.1)
Requires-Dist: respan-sdk (>=2.6.1)
Requires-Dist: respan-tracing (>=2.17.0,<3.0.0)
Description-Content-Type: text/markdown

# respan-instrumentation-google-genai

Respan instrumentation plugin for the official
[Google Gen AI SDK](https://googleapis.github.io/python-genai/).

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

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

## Usage

```python
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()
```

