Skip to main content

Crate rig_vertexai

Crate rig_vertexai 

Source
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 anthropic publisher’s rawPredict endpoint (streamRawPredict when 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 and anthropic_version travels in the body.
client
completion
The Vertex AI GenerateContent completion 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". VertexOptions holds the GenerateContent fields Vertex AI’s request declares, and VertexExtras reads its reply.