pub struct Runs<'c, C: Config> {
pub thread_id: String,
/* private fields */
}
Expand description
Represents an execution run on a thread.
Related guide: Assistants
Fields§
§thread_id: String
Implementations§
Source§impl<'c, C: Config> Runs<'c, C>
impl<'c, C: Config> Runs<'c, C>
pub fn new(client: &'c Client<C>, thread_id: &str) -> Self
Sourcepub async fn create(
&self,
request: CreateRunRequest,
) -> Result<RunObject, OpenAIError>
pub async fn create( &self, request: CreateRunRequest, ) -> Result<RunObject, OpenAIError>
Create a run. Create a run.
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 a run.
Sourcepub async fn create_stream(
&self,
request: CreateRunRequest,
) -> Result<AssistantEventStream, OpenAIError>
pub async fn create_stream( &self, request: CreateRunRequest, ) -> Result<AssistantEventStream, OpenAIError>
Create a run.
byot: You must ensure “stream: true” in serialized request
Create a run.
byot: You must ensure “stream: true” in serialized request
Sourcepub async fn create_stream_byot<T0: Serialize, R>(
&self,
request: T0,
) -> Result<Pin<Box<dyn Stream<Item = Result<R, OpenAIError>> + Send>>, OpenAIError>
pub async fn create_stream_byot<T0: Serialize, R>( &self, request: T0, ) -> Result<Pin<Box<dyn Stream<Item = Result<R, OpenAIError>> + Send>>, OpenAIError>
Create a run.
byot: You must ensure “stream: true” in serialized request
Sourcepub async fn retrieve(&self, run_id: &str) -> Result<RunObject, OpenAIError>
pub async fn retrieve(&self, run_id: &str) -> Result<RunObject, OpenAIError>
Retrieves a run. Retrieves a run.
Sourcepub async fn retrieve_byot<T0: Display, R: DeserializeOwned>(
&self,
run_id: T0,
) -> Result<R, OpenAIError>
pub async fn retrieve_byot<T0: Display, R: DeserializeOwned>( &self, run_id: T0, ) -> Result<R, OpenAIError>
Retrieves a run.
Sourcepub async fn update(
&self,
run_id: &str,
request: ModifyRunRequest,
) -> Result<RunObject, OpenAIError>
pub async fn update( &self, run_id: &str, request: ModifyRunRequest, ) -> Result<RunObject, OpenAIError>
Modifies a run. Modifies a run.
Sourcepub async fn update_byot<T0: Display, T1: Serialize, R: DeserializeOwned>(
&self,
run_id: T0,
request: T1,
) -> Result<R, OpenAIError>
pub async fn update_byot<T0: Display, T1: Serialize, R: DeserializeOwned>( &self, run_id: T0, request: T1, ) -> Result<R, OpenAIError>
Modifies a run.
Sourcepub async fn list<Q>(&self, query: &Q) -> Result<ListRunsResponse, OpenAIError>
pub async fn list<Q>(&self, query: &Q) -> Result<ListRunsResponse, OpenAIError>
Returns a list of runs belonging to a thread. Returns a list of runs belonging to a thread.
Sourcepub async fn list_byot<T0: Serialize, R: DeserializeOwned>(
&self,
query: T0,
) -> Result<R, OpenAIError>
pub async fn list_byot<T0: Serialize, R: DeserializeOwned>( &self, query: T0, ) -> Result<R, OpenAIError>
Returns a list of runs belonging to a thread.
Sourcepub async fn submit_tool_outputs(
&self,
run_id: &str,
request: SubmitToolOutputsRunRequest,
) -> Result<RunObject, OpenAIError>
pub async fn submit_tool_outputs( &self, run_id: &str, request: SubmitToolOutputsRunRequest, ) -> Result<RunObject, OpenAIError>
When a run has the status: “requires_action” and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they’re all completed. All outputs must be submitted in a single request. When a run has the status: “requires_action” and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they’re all completed. All outputs must be submitted in a single request.
Sourcepub async fn submit_tool_outputs_byot<T0: Display, T1: Serialize, R: DeserializeOwned>(
&self,
run_id: T0,
request: T1,
) -> Result<R, OpenAIError>
pub async fn submit_tool_outputs_byot<T0: Display, T1: Serialize, R: DeserializeOwned>( &self, run_id: T0, request: T1, ) -> Result<R, OpenAIError>
When a run has the status: “requires_action” and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they’re all completed. All outputs must be submitted in a single request.
Sourcepub async fn submit_tool_outputs_stream(
&self,
run_id: &str,
request: SubmitToolOutputsRunRequest,
) -> Result<AssistantEventStream, OpenAIError>
pub async fn submit_tool_outputs_stream( &self, run_id: &str, request: SubmitToolOutputsRunRequest, ) -> Result<AssistantEventStream, OpenAIError>
byot: You must ensure “stream: true” in serialized request
byot: You must ensure “stream: true” in serialized request
Sourcepub async fn submit_tool_outputs_stream_byot<T0: Display, T1: Serialize, R>(
&self,
run_id: T0,
request: T1,
) -> Result<Pin<Box<dyn Stream<Item = Result<R, OpenAIError>> + Send>>, OpenAIError>
pub async fn submit_tool_outputs_stream_byot<T0: Display, T1: Serialize, R>( &self, run_id: T0, request: T1, ) -> Result<Pin<Box<dyn Stream<Item = Result<R, OpenAIError>> + Send>>, OpenAIError>
byot: You must ensure “stream: true” in serialized request
Sourcepub async fn cancel(&self, run_id: &str) -> Result<RunObject, OpenAIError>
pub async fn cancel(&self, run_id: &str) -> Result<RunObject, OpenAIError>
Cancels a run that is in_progress
Cancels a run that is in_progress
Sourcepub async fn cancel_byot<T0: Display, R: DeserializeOwned>(
&self,
run_id: T0,
) -> Result<R, OpenAIError>
pub async fn cancel_byot<T0: Display, R: DeserializeOwned>( &self, run_id: T0, ) -> Result<R, OpenAIError>
Cancels a run that is in_progress