vertex

command
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Google Cloud Vertex AI example for Chronos.

Vertex AI exposes an OpenAI-compatible endpoint (public preview) that Chronos can drive through NewOpenAICompatibleWithConfig. Auth uses a short-lived GCP access token (Bearer) rather than a static API key.

Prerequisites:

  • A GCP project with Vertex AI API enabled
  • `gcloud auth application-default login` (or a workload-identity token)
  • Go 1.24+

Set the following environment variables before running:

export GOOGLE_CLOUD_PROJECT=<your-gcp-project-id>
export GOOGLE_CLOUD_LOCATION=us-central1
export VERTEX_MODEL=google/gemini-2.5-pro
export GOOGLE_ACCESS_TOKEN=$(gcloud auth print-access-token)

Run:

go run ./examples/vertex/main.go
go run ./examples/vertex/main.go -stream

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL