pub struct AzureChatbotConfiguration {
pub api_key: SecretString,
pub api_base: Url,
pub project_name: String,
}Fields§
§api_key: SecretString§api_base: UrlEnds in / because it is a Url::join base and joined paths must be relative.
project_name: StringImplementations§
Source§impl AzureChatbotConfiguration
impl AzureChatbotConfiguration
Sourcepub fn try_from_env() -> Result<Option<Self>>
pub fn try_from_env() -> Result<Option<Self>>
Attempts to create an AzureChatbotConfiguration from environment variables.
Needs all three of AZURE_CHATBOT_API_KEY, AZURE_CHATBOT_API_ENDPOINT and
AZURE_PROJECT_NAME. Any of them missing gives Ok(None) rather than an error, so a caller
that requires a chatbot has to reject the None itself. Errors only on a set value that
fails to parse.
Sourcefn from_values(
api_key: String,
api_endpoint: &str,
project_name: String,
) -> Result<Self>
fn from_values( api_key: String, api_endpoint: &str, project_name: String, ) -> Result<Self>
Pure so the join base can be tested without touching process env.
pub fn responses_endpoint(&self) -> Result<Url>
pub fn embeddings_endpoint(&self) -> Result<Url>
Trait Implementations§
Source§impl Clone for AzureChatbotConfiguration
impl Clone for AzureChatbotConfiguration
Source§fn clone(&self) -> AzureChatbotConfiguration
fn clone(&self) -> AzureChatbotConfiguration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AzureChatbotConfiguration
impl RefUnwindSafe for AzureChatbotConfiguration
impl Send for AzureChatbotConfiguration
impl Sync for AzureChatbotConfiguration
impl Unpin for AzureChatbotConfiguration
impl UnsafeUnpin for AzureChatbotConfiguration
impl UnwindSafe for AzureChatbotConfiguration
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more