vertex

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package vertex provides Google Vertex AI's documented Gemini generateContent route and Anthropic Claude rawPredict route. It reuses the shared Gemini and Anthropic codecs; only Vertex routing, bearer authentication, and the Vertex-required anthropic_version field are provider-specific.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(selected model.Model, accessToken auth.APIKey, options ...Option) (inference.Client, error)

New constructs a Vertex client using a caller-supplied OAuth bearer token. ProviderGoogleVertex selects Gemini or Anthropic from Model.APIFormat; ProviderGoogleVertexAnthropic is restricted to Anthropic by llm.ValidateModel.

Types

type ConfigurationError

type ConfigurationError struct {
	Reason ConfigurationReason
}

func (*ConfigurationError) Error

func (e *ConfigurationError) Error() string

type ConfigurationReason

type ConfigurationReason string
const (
	ProjectOrLocationMissing ConfigurationReason = "project or location is missing"
	ProjectOrLocationInvalid ConfigurationReason = "project or location is invalid"
	ModelMissing             ConfigurationReason = "model name is missing"
)

type CounterSupportError

type CounterSupportError = llm.CounterSupportError

type Option

type Option func(*config)

Option configures Vertex project/region routing or adds a documented request header. The access token passed to New must already be an OAuth/ADC bearer token; this package does not perform an interactive gcloud login.

func WithAnthropicVersion

func WithAnthropicVersion(version string) Option

WithAnthropicVersion overrides Vertex's native Claude request version. The default is the version documented by Vertex's Claude rawPredict examples.

func WithHeader

func WithHeader(name, value string) Option

func WithLocation

func WithLocation(location string) Option

func WithProject

func WithProject(project string) Option

Jump to

Keyboard shortcuts

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