Integrate Proxy with the Google Vertex AI SDK to automatically capture telemetry.
Demonstrated with Vertex AI’s Python SDK but should work in most languages.
from google import genaifrom google.genai import typesclient = genai.Client( http_options={ "base_url": "https://gateway.adaline.ai/v1/vertex", "headers": { "adaline-api-key": "your-adaline-api-key", "adaline-project-id": "your-project-id", "adaline-prompt-id": "your-prompt-id", }, }, vertexai=True, project="your-gcp-project-id", location="us-central1",)response = client.models.generate_content( model="gemini-1.5-pro", contents="You are a helpful assistant.\n\nWhat are the advantages of using Google Cloud for AI workloads?", config=types.GenerateContentConfig( http_options=types.HttpOptions( headers={ "adaline-trace-name": "vertex-chat-completion" # Optional } ) ))print(response.text)