pub struct Responses<'c, C: Config> { /* private fields */ }
Expand description
Given text input or a list of context items, the model will generate a response.
Related guide: Responses
Implementations§
Source§impl<'c, C: Config> Responses<'c, C>
impl<'c, C: Config> Responses<'c, C>
Sourcepub async fn create(
&self,
request: CreateResponse,
) -> Result<Response, OpenAIError>
pub async fn create( &self, request: CreateResponse, ) -> Result<Response, OpenAIError>
Creates a model response for the given input. Creates a model response for the given input.
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>
Creates a model response for the given input.
Sourcepub async fn create_stream(
&self,
request: CreateResponse,
) -> Result<ResponseStream, OpenAIError>
pub async fn create_stream( &self, request: CreateResponse, ) -> Result<ResponseStream, OpenAIError>
Creates a model response for the given input with streaming.
Response events will be sent as server-sent events as they become available, Creates a model response for the given input with streaming.
Response events will be sent as server-sent events as they become available,
Sourcepub async fn create_stream_byot<T0: Serialize, R>(
&self,
request: T0,
) -> Result<Pin<Box<dyn Stream<Item = Result<R, OpenAIError>> + Send>>, OpenAIError>where
R: Send + 'static + DeserializeOwned,
pub async fn create_stream_byot<T0: Serialize, R>(
&self,
request: T0,
) -> Result<Pin<Box<dyn Stream<Item = Result<R, OpenAIError>> + Send>>, OpenAIError>where
R: Send + 'static + DeserializeOwned,
Creates a model response for the given input with streaming.
Response events will be sent as server-sent events as they become available,
Auto Trait Implementations§
impl<'c, C> Freeze for Responses<'c, C>
impl<'c, C> !RefUnwindSafe for Responses<'c, C>
impl<'c, C> Send for Responses<'c, C>
impl<'c, C> Sync for Responses<'c, C>
impl<'c, C> Unpin for Responses<'c, C>
impl<'c, C> !UnwindSafe for Responses<'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