pub struct FoundryAdapter { /* private fields */ }Available on crate feature
azure only.Implementations§
Source§impl FoundryAdapter
impl FoundryAdapter
pub async fn from_env(config: ProviderConfig) -> Result<Self>
pub async fn from_config( config: ProviderConfig, foundry: FoundryConfig, ) -> Result<Self>
Sourcepub fn with_resource(self, resource: impl Into<String>) -> Self
pub fn with_resource(self, resource: impl Into<String>) -> Self
Set the Azure resource name.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Set the base URL (alternative to resource name).
Sourcepub fn with_api_key(self, key: impl Into<String>) -> Self
pub fn with_api_key(self, key: impl Into<String>) -> Self
Set the API key for authentication.
Trait Implementations§
Source§impl Debug for FoundryAdapter
impl Debug for FoundryAdapter
Source§impl ProviderAdapter for FoundryAdapter
impl ProviderAdapter for FoundryAdapter
fn config(&self) -> &ProviderConfig
fn name(&self) -> &'static str
fn build_url<'life0, 'life1, 'async_trait>(
&'life0 self,
_model: &'life1 str,
_stream: bool,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transform_request<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transform_response(&self, response: Value) -> Result<ApiResponse>
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
http: &'life1 Client,
request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = Result<ApiResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
http: &'life1 Client,
request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn refresh_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn model(&self, model_type: ModelType) -> &str
fn prepare_request<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = CreateMessageRequest> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_auth_headers<'life0, 'async_trait>(
&'life0 self,
req: RequestBuilder,
) -> Pin<Box<dyn Future<Output = RequestBuilder> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn supports_credential_refresh(&self) -> bool
fn ensure_fresh_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_tokens<'life0, 'life1, 'async_trait>(
&'life0 self,
_http: &'life1 Client,
_request: CountTokensRequest,
) -> Pin<Box<dyn Future<Output = Result<CountTokensResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl !Freeze for FoundryAdapter
impl !RefUnwindSafe for FoundryAdapter
impl Send for FoundryAdapter
impl Sync for FoundryAdapter
impl Unpin for FoundryAdapter
impl UnsafeUnpin for FoundryAdapter
impl !UnwindSafe for FoundryAdapter
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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.