Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions rig-integrations/rig-vertexai/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tokio = { workspace = true, features = ["full"] }
tracing = { workspace = true }
anyhow = { workspace = true }
async-stream = { workspace = true }
futures = { workspace = true }
http = "1.3.1"
reqwest = { version = "0.12", features = ["json"] }
reqwest-middleware = "0.4"
async-trait = "0.1"

[dev-dependencies]
anyhow = { workspace = true }
Expand Down
23 changes: 23 additions & 0 deletions rig-integrations/rig-vertexai/src/auth.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//! GCP authentication for Vertex AI API requests
//!
//! This module provides authentication helpers for Vertex AI streaming requests.

/// Placeholder for future authentication middleware
///
/// Note: GCP token fetching is currently handled directly in streaming.rs
/// using Application Default Credentials (ADC) via google-cloud-auth.
#[derive(Clone, Debug)]
pub struct GcpAuthMiddleware;

impl GcpAuthMiddleware {
/// Create a new GCP auth middleware
pub fn new() -> Self {
Self
}
}

impl Default for GcpAuthMiddleware {
fn default() -> Self {
Self::new()
}
}
5 changes: 5 additions & 0 deletions rig-integrations/rig-vertexai/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ impl Client {
})
.await
}

/// Get GCP access token from credentials for manual authentication
pub fn credentials(&self) -> &google_cloud_auth::credentials::Credentials {
&self.credentials
}
}

impl Default for Client {
Expand Down
4 changes: 4 additions & 0 deletions rig-integrations/rig-vertexai/src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ pub const GEMINI_2_5_FLASH_LITE: &str = "gemini-2.5-flash-lite";
pub const GEMINI_2_5_FLASH: &str = "gemini-2.5-flash";
/// `gemini-2.5-pro`
pub const GEMINI_2_5_PRO: &str = "gemini-2.5-pro";
/// `gemini-3-pro-preview`
pub const GEMINI_3_PRO_PREVIEW: &str = "gemini-3-pro-preview";
/// `gemini-3-flash-preview`
pub const GEMINI_3_FLASH_PREVIEW: &str = "gemini-3-flash-preview";

#[derive(Clone)]
pub struct CompletionModel {
Expand Down
3 changes: 3 additions & 0 deletions rig-integrations/rig-vertexai/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
pub mod auth;
pub mod client;
pub mod completion;
pub mod streaming;
pub(crate) mod types;

pub use client::{Client, ClientBuilder};
pub use streaming::StreamingCompletionModel;
Loading