pub struct Responses<'c, C: Config> { /* private fields */ }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. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response. Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response.
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. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response.
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,
Sourcepub async fn retrieve<Q>(
&self,
response_id: &str,
query: &Q,
) -> Result<Response, OpenAIError>
pub async fn retrieve<Q>( &self, response_id: &str, query: &Q, ) -> Result<Response, OpenAIError>
Retrieves a model response with the given ID. Retrieves a model response with the given ID.
Sourcepub async fn retrieve_byot<T0: Display, T1: Serialize, R: DeserializeOwned>(
&self,
response_id: T0,
query: T1,
) -> Result<R, OpenAIError>
pub async fn retrieve_byot<T0: Display, T1: Serialize, R: DeserializeOwned>( &self, response_id: T0, query: T1, ) -> Result<R, OpenAIError>
Retrieves a model response with the given ID.
Sourcepub async fn delete(
&self,
response_id: &str,
) -> Result<DeleteResponse, OpenAIError>
pub async fn delete( &self, response_id: &str, ) -> Result<DeleteResponse, OpenAIError>
Deletes a model response with the given ID. Deletes a model response with the given ID.
Sourcepub async fn delete_byot<T0: Display, R: DeserializeOwned>(
&self,
response_id: T0,
) -> Result<R, OpenAIError>
pub async fn delete_byot<T0: Display, R: DeserializeOwned>( &self, response_id: T0, ) -> Result<R, OpenAIError>
Deletes a model response with the given ID.
Sourcepub async fn cancel(&self, response_id: &str) -> Result<Response, OpenAIError>
pub async fn cancel(&self, response_id: &str) -> Result<Response, OpenAIError>
Cancels a model response with the given ID. Only responses created with the
background parameter set to true can be cancelled.
Learn more.
Cancels a model response with the given ID. Only responses created with the
background parameter set to true can be cancelled.
Learn more.
Sourcepub async fn cancel_byot<T0: Display, R: DeserializeOwned>(
&self,
response_id: T0,
) -> Result<R, OpenAIError>
pub async fn cancel_byot<T0: Display, R: DeserializeOwned>( &self, response_id: T0, ) -> Result<R, OpenAIError>
Cancels a model response with the given ID. Only responses created with the
background parameter set to true can be cancelled.
Learn more.
Sourcepub async fn list_input_items<Q>(
&self,
response_id: &str,
query: &Q,
) -> Result<ResponseItemList, OpenAIError>
pub async fn list_input_items<Q>( &self, response_id: &str, query: &Q, ) -> Result<ResponseItemList, OpenAIError>
Returns a list of input items for a given response. Returns a list of input items for a given response.
Sourcepub async fn list_input_items_byot<T0: Display, T1: Serialize, R: DeserializeOwned>(
&self,
response_id: T0,
query: T1,
) -> Result<R, OpenAIError>
pub async fn list_input_items_byot<T0: Display, T1: Serialize, R: DeserializeOwned>( &self, response_id: T0, query: T1, ) -> Result<R, OpenAIError>
Returns a list of input items for a given response.
Sourcepub async fn get_input_token_counts(
&self,
request: TokenCountsBody,
) -> Result<TokenCountsResource, OpenAIError>
pub async fn get_input_token_counts( &self, request: TokenCountsBody, ) -> Result<TokenCountsResource, OpenAIError>
Get input token counts Get input token counts
Sourcepub async fn get_input_token_counts_byot<T0: Serialize, R: DeserializeOwned>(
&self,
request: T0,
) -> Result<R, OpenAIError>
pub async fn get_input_token_counts_byot<T0: Serialize, R: DeserializeOwned>( &self, request: T0, ) -> Result<R, OpenAIError>
Get input token counts