pub struct OpenAICompatibleChatModelBuilder<const WITH_NAME: bool> { /* private fields */ }
Expand description
A builder for an openai compatible chat model.
Implementations§
Source§impl OpenAICompatibleChatModelBuilder<false>
impl OpenAICompatibleChatModelBuilder<false>
Source§impl<const WITH_NAME: bool> OpenAICompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> OpenAICompatibleChatModelBuilder<WITH_NAME>
Sourcepub fn with_model(
self,
model: impl ToString,
) -> OpenAICompatibleChatModelBuilder<true>
pub fn with_model( self, model: impl ToString, ) -> OpenAICompatibleChatModelBuilder<true>
Set the name of the model to use.
Sourcepub fn with_gpt_4o(self) -> OpenAICompatibleChatModelBuilder<true>
pub fn with_gpt_4o(self) -> OpenAICompatibleChatModelBuilder<true>
Set the model to the latest version of gpt 4o
Sourcepub fn with_chat_gpt_4o(self) -> OpenAICompatibleChatModelBuilder<true>
pub fn with_chat_gpt_4o(self) -> OpenAICompatibleChatModelBuilder<true>
Set the model to the latest version of chat gpt 4o used in ChatGPT
Sourcepub fn with_gpt_4o_mini(self) -> OpenAICompatibleChatModelBuilder<true>
pub fn with_gpt_4o_mini(self) -> OpenAICompatibleChatModelBuilder<true>
Set the model to the latest version of gpt 4o mini
Sourcepub fn with_client(self, client: OpenAICompatibleClient) -> Self
pub fn with_client(self, client: OpenAICompatibleClient) -> Self
Set the client used to make requests to the OpenAI API.
Source§impl OpenAICompatibleChatModelBuilder<true>
impl OpenAICompatibleChatModelBuilder<true>
Sourcepub fn build(self) -> OpenAICompatibleChatModel
pub fn build(self) -> OpenAICompatibleChatModel
Build the model.
Trait Implementations§
Source§impl<const WITH_NAME: bool> Debug for OpenAICompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Debug for OpenAICompatibleChatModelBuilder<WITH_NAME>
Source§impl<const WITH_NAME: bool> Default for OpenAICompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Default for OpenAICompatibleChatModelBuilder<WITH_NAME>
Source§fn default() -> OpenAICompatibleChatModelBuilder<WITH_NAME>
fn default() -> OpenAICompatibleChatModelBuilder<WITH_NAME>
Returns the “default value” for a type. Read more
Source§impl ModelBuilder for OpenAICompatibleChatModelBuilder<true>
impl ModelBuilder for OpenAICompatibleChatModelBuilder<true>
Source§type Model = OpenAICompatibleChatModel
type Model = OpenAICompatibleChatModel
The model that this trait creates.
Source§type Error = Infallible
type Error = Infallible
An error that can occur when creating the model.
Source§async fn start_with_loading_handler(
self,
_: impl FnMut(ModelLoadingProgress) + Send + Sync + 'static,
) -> Result<Self::Model, Self::Error>
async fn start_with_loading_handler( self, _: impl FnMut(ModelLoadingProgress) + Send + Sync + 'static, ) -> Result<Self::Model, Self::Error>
Start the model with a loading handler.
Source§fn requires_download(&self) -> bool
fn requires_download(&self) -> bool
Check if the model will need to be downloaded before use (default: false)
Auto Trait Implementations§
impl<const WITH_NAME: bool> !Freeze for OpenAICompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> !RefUnwindSafe for OpenAICompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Send for OpenAICompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Sync for OpenAICompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Unpin for OpenAICompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> !UnwindSafe for OpenAICompatibleChatModelBuilder<WITH_NAME>
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