pub struct VertexProvider {
pub id: String,
pub region: Option<String>,
pub project: Option<String>,
pub http: Client,
}Expand description
Speaks POST https://{region}-aiplatform.googleapis.com/.../publishers/anthropic/models/{model}:rawPredict
(Claude on Google Vertex AI) — an Anthropic-shaped body ([anthropic_messages_body])
authenticated with a GCP OAuth2 bearer token rather than an API key (ADR 0006 P3). The token is
minted and cached by gcp_auth from GOOGLE_APPLICATION_CREDENTIALS or the ambient GCP
environment — this adapter never caches or logs it, and it never goes in the URL (I2).
Fields§
§id: StringLadder prefix / trace label (usually "vertex").
region: Option<String>GCP region Vertex is called in, e.g. "us-central1".
project: Option<String>GCP project id.
http: ClientShared, connection-pooled HTTP client.
Trait Implementations§
Source§impl Clone for VertexProvider
impl Clone for VertexProvider
Source§fn clone(&self) -> VertexProvider
fn clone(&self) -> VertexProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VertexProvider
impl Debug for VertexProvider
Source§impl Provider for VertexProvider
impl Provider for VertexProvider
Source§fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
_auth: &'life2 Auth,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ModelRequest,
_auth: &'life2 Auth,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Call the model and normalize the result. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for VertexProvider
impl !UnwindSafe for VertexProvider
impl Freeze for VertexProvider
impl Send for VertexProvider
impl Sync for VertexProvider
impl Unpin for VertexProvider
impl UnsafeUnpin for VertexProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.