pub struct Assistants<'c, C: Config> { /* private fields */ }Available on crate feature
assistant only.Expand description
Build assistants that can call models and use tools to perform tasks.
Implementations§
Source§impl<'c, C: Config> Assistants<'c, C>
impl<'c, C: Config> Assistants<'c, C>
pub fn new(client: &'c Client<C>) -> Self
Sourcepub async fn create(
&self,
request: CreateAssistantRequest,
) -> Result<AssistantObject, OpenAIError>
pub async fn create( &self, request: CreateAssistantRequest, ) -> Result<AssistantObject, OpenAIError>
Create an assistant with a model and instructions. Create an assistant with a model and instructions.
Sourcepub async fn create_byot<T0: Serialize, R: DeserializeOwned>(
&self,
request: T0,
) -> Result<R, OpenAIError>
pub async fn create_byot<T0: Serialize, R: DeserializeOwned>( &self, request: T0, ) -> Result<R, OpenAIError>
Create an assistant with a model and instructions.
Sourcepub async fn retrieve(
&self,
assistant_id: &str,
) -> Result<AssistantObject, OpenAIError>
pub async fn retrieve( &self, assistant_id: &str, ) -> Result<AssistantObject, OpenAIError>
Retrieves an assistant. Retrieves an assistant.
Sourcepub async fn retrieve_byot<T0: Display, R: DeserializeOwned>(
&self,
assistant_id: T0,
) -> Result<R, OpenAIError>
pub async fn retrieve_byot<T0: Display, R: DeserializeOwned>( &self, assistant_id: T0, ) -> Result<R, OpenAIError>
Retrieves an assistant.
Sourcepub async fn update(
&self,
assistant_id: &str,
request: ModifyAssistantRequest,
) -> Result<AssistantObject, OpenAIError>
pub async fn update( &self, assistant_id: &str, request: ModifyAssistantRequest, ) -> Result<AssistantObject, OpenAIError>
Modifies an assistant. Modifies an assistant.
Sourcepub async fn update_byot<T0: Display, T1: Serialize, R: DeserializeOwned>(
&self,
assistant_id: T0,
request: T1,
) -> Result<R, OpenAIError>
pub async fn update_byot<T0: Display, T1: Serialize, R: DeserializeOwned>( &self, assistant_id: T0, request: T1, ) -> Result<R, OpenAIError>
Modifies an assistant.
Sourcepub async fn delete(
&self,
assistant_id: &str,
) -> Result<DeleteAssistantResponse, OpenAIError>
pub async fn delete( &self, assistant_id: &str, ) -> Result<DeleteAssistantResponse, OpenAIError>
Delete an assistant. Delete an assistant.
Sourcepub async fn delete_byot<T0: Display, R: DeserializeOwned>(
&self,
assistant_id: T0,
) -> Result<R, OpenAIError>
pub async fn delete_byot<T0: Display, R: DeserializeOwned>( &self, assistant_id: T0, ) -> Result<R, OpenAIError>
Delete an assistant.
Sourcepub async fn list(&self) -> Result<ListAssistantsResponse, OpenAIError>
pub async fn list(&self) -> Result<ListAssistantsResponse, OpenAIError>
Returns a list of assistants. Returns a list of assistants.
Sourcepub async fn list_byot<R: DeserializeOwned>(&self) -> Result<R, OpenAIError>
pub async fn list_byot<R: DeserializeOwned>(&self) -> Result<R, OpenAIError>
Returns a list of assistants.
Trait Implementations§
Source§impl<'c, C: Config> RequestOptionsBuilder for Assistants<'c, C>
Available on crate feature _api only.
impl<'c, C: Config> RequestOptionsBuilder for Assistants<'c, C>
Available on crate feature
_api only.Source§fn options_mut(&mut self) -> &mut RequestOptions
fn options_mut(&mut self) -> &mut RequestOptions
Get mutable reference to RequestOptions (for building)
Source§fn options(&self) -> &RequestOptions
fn options(&self) -> &RequestOptions
Get reference to RequestOptions
Source§fn header<K, V>(self, key: K, value: V) -> Result<Self, OpenAIError>
fn header<K, V>(self, key: K, value: V) -> Result<Self, OpenAIError>
Add a single header to RequestOptions
Auto Trait Implementations§
impl<'c, C> Freeze for Assistants<'c, C>
impl<'c, C> !RefUnwindSafe for Assistants<'c, C>
impl<'c, C> Send for Assistants<'c, C>
impl<'c, C> Sync for Assistants<'c, C>
impl<'c, C> Unpin for Assistants<'c, C>
impl<'c, C> !UnwindSafe for Assistants<'c, C>
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