Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AnthropicModels = map[string]ai.ModelOptions{ "claude-opus-4-7": { Label: "Claude Opus 4.7", Supports: &internal.Multimodal, }, "claude-opus-4-6": { Label: "Claude Opus 4.6", Supports: &internal.Multimodal, }, "claude-sonnet-4-6": { Label: "Claude Sonnet 4.6", Supports: &internal.Multimodal, }, "claude-opus-4-5": { Label: "Claude Opus 4.5", Supports: &internal.Multimodal, }, "claude-opus-4-1": { Label: "Claude Opus 4.1", Supports: &internal.Multimodal, }, "claude-opus-4": { Label: "Claude Opus 4", Supports: &internal.Multimodal, }, "claude-sonnet-4-5": { Label: "Claude Sonnet 4.5", Supports: &internal.Multimodal, }, "claude-sonnet-4": { Label: "Claude Sonnet 4", Supports: &internal.Multimodal, }, "claude-3-7-sonnet": { Label: "Claude 3.7 Sonnet", Supports: &internal.Multimodal, }, "claude-3-5-sonnet-v2": { Label: "Claude 3.5 Sonnet", Supports: &internal.Multimodal, }, "claude-haiku-4-5": { Label: "Claude Haiku 4.5", Supports: &internal.Multimodal, }, "claude-3-5-haiku": { Label: "Claude 3.5 Haiku", Supports: &internal.Multimodal, }, "claude-3-5-sonnet": { Label: "Claude 3.5 Sonnet", Supports: &internal.Multimodal, }, "claude-3-sonnet": { Label: "Claude 3 Sonnet", Supports: &internal.Multimodal, }, "claude-3-haiku": { Label: "Claude 3 Haiku", Supports: &internal.Multimodal, Stage: ai.ModelStageDeprecated, }, "claude-3-opus": { Label: "Claude 3 Opus", Supports: &internal.Multimodal, }, "claude-opus-4@20250514": { Label: "Claude Opus 4", Supports: &internal.Multimodal, Stage: ai.ModelStageDeprecated, }, "claude-sonnet-4@20250514": { Label: "Claude Sonnet 4", Supports: &internal.Multimodal, Stage: ai.ModelStageDeprecated, }, "claude-3-7-sonnet@20250219": { Label: "Claude 3.7 Sonnet", Supports: &internal.Multimodal, Stage: ai.ModelStageDeprecated, }, "claude-3-5-sonnet-v2@20241022": { Label: "Claude 3.5 Sonnet", Supports: &internal.Multimodal, Stage: ai.ModelStageDeprecated, }, "claude-3-5-sonnet@20240620": { Label: "Claude 3.5 Sonnet", Supports: &internal.Multimodal, Stage: ai.ModelStageDeprecated, }, "claude-3-sonnet@20240229": { Label: "Claude 3 Sonnet", Supports: &internal.Multimodal, Stage: ai.ModelStageDeprecated, }, "claude-3-haiku@20240307": { Label: "Claude 3 Haiku", Supports: &internal.Multimodal, Stage: ai.ModelStageDeprecated, }, "claude-3-opus@20240229": { Label: "Claude 3 Opus", Supports: &internal.Multimodal, Stage: ai.ModelStageDeprecated, }, }
AnthropicModels is a list of models supported in VertexAI. Keep this list updated since models cannot be dynamically listed if we are authenticating with Google Credentials. Keys must be Vertex AI publisher model IDs, not Anthropic API date-versioned IDs.
var LlamaModels = map[string]ai.ModelOptions{ "meta/llama-4-maverick-17b-128e-instruct-maas": { Label: "Llama 4 Maverick 17B 128E Instruct", Supports: &internal.Multimodal, }, "meta/llama-4-scout-17b-16e-instruct-maas": { Label: "Llama 4 Scout 17B 16E Instruct", Supports: &internal.Multimodal, }, "meta/llama-3.3-70b-instruct-maas": { Label: "Llama 3.3 70B Instruct", Supports: &internal.BasicText, }, }
LlamaModels lists the Meta Llama models available through Vertex AI Model Garden as Model-as-a-Service (MaaS) endpoints. These models are served via an OpenAI-compatible API.
var MistralModels = map[string]ai.ModelOptions{ "mistral-medium-3": { Label: "Mistral Medium 3", Supports: &internal.BasicText, }, "mistral-small-2503": { Label: "Mistral Small 2503", Supports: &internal.BasicText, }, "codestral-2": { Label: "Codestral 2", Supports: &internal.BasicText, }, }
MistralModels lists the Mistral and Codestral models available through Vertex AI Model Garden as Model-as-a-Service (MaaS) endpoints. Capabilities match the JS parity target (media: false, tools: true, systemRole: true). Keys are the bare publisher model ids ("mistral-small-2503" rather than "mistralai/mistral-small-2503"). Vertex serves Mistral via per-model rawPredict URLs where the publisher lives in the URL path, not the model field; the Mistral plugin's HTTP transport assembles those URLs. The "mistralai/" prefix is still accepted by MistralModel as a convenience for callers used to the publisher-qualified form.
Functions ¶
func AnthropicModel ¶
AnthropicModel returns the ai.Model with the given id. It returns nil if the model was not defined
func LlamaModel ¶ added in v1.9.0
LlamaModel returns the Llama ai.Model with the given id, or nil if it was not defined.
func MistralModel ¶ added in v1.12.0
MistralModel returns the Mistral/Codestral ai.Model with the given id, or nil if it was not defined. Both bare ids ("mistral-small-2503") and publisher-qualified ids ("mistralai/mistral-small-2503") resolve to the same registered model.
Types ¶
type Anthropic ¶
type Anthropic struct {
ProjectID string // Google Cloud project to use for Vertex AI. If empty, the value of the environment variable GOOGLE_CLOUD_PROJECT or GCLOUD_PROJECT will be consulted in that order
Location string // Location of the Vertex AI service. If empty, the value of the environment variable GOOGLE_CLOUD_LOCATION or GOOGLE_CLOUD_REGION will be consulted in that order
// contains filtered or unexported fields
}
Anthropic is a Genkit plugin for interacting with Anthropic models in Vertex AI Model Garden
func (*Anthropic) DefineModel ¶
DefineModel builds a Model Garden Claude model and returns it. It does not register the model: generation resolves a model from its name, so passing the result to ai.WithModel contributes only that name and serves the request with a model resolved from it instead. Pass the result to genkit.RegisterAction to make these capabilities the ones used.
type Llama ¶ added in v1.9.0
type Llama struct {
// ProjectID is the Google Cloud project to use for Vertex AI. If empty,
// the value of the environment variable GOOGLE_CLOUD_PROJECT or
// GCLOUD_PROJECT will be consulted in that order.
ProjectID string
// Location is the Vertex AI location (e.g. "us-central1"). If empty, the
// value of GOOGLE_CLOUD_LOCATION or GOOGLE_CLOUD_REGION will be
// consulted.
Location string
// contains filtered or unexported fields
}
Llama is a Genkit plugin for interacting with Meta Llama MaaS models in Vertex AI Model Garden. Llama models on Vertex are served via an OpenAI-compatible endpoint (`.../endpoints/openapi`) and authenticated with a Google OAuth2 access token.
func (*Llama) DefineModel ¶ added in v1.9.0
DefineModel builds a Llama model. The model is not registered: register the returned model with genkit.RegisterAction before generating with it.
type Mistral ¶ added in v1.12.0
type Mistral struct {
// ProjectID is the Google Cloud project to use for Vertex AI. If empty,
// the value of the environment variable GOOGLE_CLOUD_PROJECT or
// GCLOUD_PROJECT will be consulted in that order.
ProjectID string
// Location is the Vertex AI location (e.g. "us-central1"). If empty, the
// value of GOOGLE_CLOUD_LOCATION or GOOGLE_CLOUD_REGION will be
// consulted.
Location string
// contains filtered or unexported fields
}
Mistral is a Genkit plugin for interacting with Mistral and Codestral MaaS models in Vertex AI Model Garden. The JS equivalent uses the native @mistralai/mistralai-gcp SDK; no maintained Mistral-GCP SDK exists for Go, and unlike Meta Llama, Mistral on Vertex is not served by the OpenAI- compatible chat completions endpoint. Requests are routed to per-model rawPredict / streamRawPredict URLs via a custom HTTP transport, while the rest of the OpenAI-shaped request and response handling is reused from compat_oai.
func (*Mistral) DefineModel ¶ added in v1.12.0
DefineModel adds a Mistral model to the registry. The optional "mistralai/" publisher prefix on name is stripped so registration stays in the bare-id namespace.