Struct async_openai::Runs
source · 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.
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.
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.
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.
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.
pub async fn submit_tool_outputs_stream( &self, run_id: &str, request: SubmitToolOutputsRunRequest, ) -> Result<AssistantEventStream, OpenAIError>
Auto Trait Implementations§
impl<'c, C> Freeze for Runs<'c, C>
impl<'c, C> !RefUnwindSafe for Runs<'c, C>
impl<'c, C> Send for Runs<'c, C>where
C: Sync,
impl<'c, C> Sync for Runs<'c, C>where
C: Sync,
impl<'c, C> Unpin for Runs<'c, C>
impl<'c, C> !UnwindSafe for Runs<'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