Expand description
The Vertex AI completion wires and the VertexAi transport they are
sent through: Gemini’s GenerateContent, and Claude through
anthropic. Configure Application Default Credentials or supply
credentials or a prediction service through VertexAiBuilder. ADC
construction requires a Tokio runtime that remains alive and driven for
the transport’s lifetime.
use rig_core::Model;
use rig_vertexai::{VertexAi, completion::{GEMINI_2_5_FLASH, GenerateContent}};
let model = VertexAi::from_env()?.completion(GEMINI_2_5_FLASH);Re-exports§
pub use client::VertexAi;pub use client::VertexAiBuilder;
Modules§
- anthropic
- Claude on Vertex AI: Anthropic’s Messages wire, sent to the
anthropicpublisher’srawPredictendpoint (streamRawPredictwhen streamed) with Google credentials. Requests and replies are the Messages API’s, so the Anthropic typed options, extras and history rules apply unchanged; the model is named in the URL andanthropic_versiontravels in the body. - client
- completion
- The Vertex AI
GenerateContentcompletion wire and model identifiers. A streamed call re-emits the unary reply: this integration has no streaming RPC. - extension
- Typed request options and reply extras for Vertex AI, keyed by
"vertexai".VertexOptionsholds the GenerateContent fields Vertex AI’s request declares, andVertexExtrasreads its reply.