pub struct ChatApi { /* private fields */ }Expand description
Legacy Chat Completions API.
Note: This API is deprecated. Use client.responses() instead.
Implementations§
Source§impl ChatApi
impl ChatApi
Sourcepub fn completions(
&self,
model: impl Into<String>,
prompt: impl Into<String>,
) -> CompletionBuilder
pub fn completions( &self, model: impl Into<String>, prompt: impl Into<String>, ) -> CompletionBuilder
Create a completion request using /v1/completions.
Sourcepub fn complete(
&self,
model: impl Into<String>,
prompt: impl Into<String>,
) -> CompletionBuilder
pub fn complete( &self, model: impl Into<String>, prompt: impl Into<String>, ) -> CompletionBuilder
Create a completion request using /v1/complete.
Sourcepub fn start_deferred_completion(
&self,
model: impl Into<String>,
) -> MessagesBuilder
pub fn start_deferred_completion( &self, model: impl Into<String>, ) -> MessagesBuilder
Create a deferred completion request using /v1/messages.
Sourcepub async fn get_deferred_completion(
&self,
deferred_id: impl AsRef<str>,
) -> Result<ChatCompletion>
pub async fn get_deferred_completion( &self, deferred_id: impl AsRef<str>, ) -> Result<ChatCompletion>
Fetch a deferred completion result by ID using /v1/chat/deferred-completion/{id}.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChatApi
impl !RefUnwindSafe for ChatApi
impl Send for ChatApi
impl Sync for ChatApi
impl Unpin for ChatApi
impl UnsafeUnpin for ChatApi
impl !UnwindSafe for ChatApi
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