Skip to main content

Respan instrumentation plugin for Google Vertex AI

Project description

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

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

Usage

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

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_vertexai-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

respan_instrumentation_vertexai-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for respan_instrumentation_vertexai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d079621c0b1d39b8c741ccf3adc87aae543e219b7fd0eb0ea1595bcac9e75af8
MD5 abcc8d939078c0129984bff2b3c73077
BLAKE2b-256 83b5440dbe6529762813a0fe9cc1717bfe3838d4b01b2303b56c2494914bb9c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for respan_instrumentation_vertexai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a2c5513ff4859556496f2d75e958f46b19ab98adaad5b6cea61eaec1216138c
MD5 b965e7fda4e60eba55e9d335162bea3b
BLAKE2b-256 ce0db3ce81db8e2667c3300ad6ecc5351b9ce1b05d6c214af7961ea3d0db32a6

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