Metadata-Version: 2.4
Name: respan-instrumentation-vertexai
Version: 0.1.0
Summary: Respan instrumentation plugin for Google Vertex 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-cloud-aiplatform (>=1.71.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-vertexai

Respan instrumentation plugin for the Google Vertex AI Python SDK.

The package patches `vertexai.generative_models.GenerativeModel` and
`ChatSession` generation methods and emits canonical Respan chat spans through
the active OTEL pipeline. It captures sync calls, async calls, streamed
responses, prompt and completion content, token usage, tool declarations, and
model function calls.

## Installation

```bash
pip install respan-ai respan-instrumentation-vertexai google-cloud-aiplatform
```

## Usage

```python
import vertexai
from respan import Respan
from respan_instrumentation_vertexai import VertexAIInstrumentor
from vertexai.generative_models import GenerativeModel

respan = Respan(instrumentations=[VertexAIInstrumentor()])

vertexai.init(project="your-gcp-project", location="us-central1")

model = GenerativeModel("gemini-2.0-flash")
response = model.generate_content("Say hello in three languages.")
print(response.text)
respan.flush()
```

