次の方法で共有


RunsClient Class

  • java.lang.Object
    • com.azure.ai.agents.persistent.RunsClient

public final class RunsClient

Initializes a new instance of the synchronous Runs type.

Method Summary

Modifier and Type Method and Description
ThreadRun cancelRun(String threadId, String runId)

Cancels a run of an in‐progress thread.

Response<BinaryData> cancelRunWithResponse(String threadId, String runId, RequestOptions requestOptions)

Cancels a run of an in‐progress thread.

ThreadRun createRun(CreateRunOptions options)

Creates a new run for an agent thread.

Stream<StreamUpdate> createRunStreaming(CreateRunOptions options)

Creates a new streaming run for an agent thread.

Response<BinaryData> createRunWithResponse(String threadId, BinaryData createRunRequest, RequestOptions requestOptions)

Creates a new run for an agent thread.

ThreadRun getRun(String threadId, String runId)

Gets an existing run from an existing thread.

RunStep getRunStep(String threadId, String runId, String stepId)

Retrieves a single run step from a thread run.

RunStep getRunStep(String threadId, String runId, String stepId, List<RunAdditionalFieldList> include)

Retrieves a single run step from a thread run.

Response<BinaryData> getRunStepWithResponse(String threadId, String runId, String stepId, RequestOptions requestOptions)

Retrieves a single run step from a thread run.

Response<BinaryData> getRunWithResponse(String threadId, String runId, RequestOptions requestOptions)

Gets an existing run from an existing thread.

PagedIterable<ThreadRun> listRuns(String threadId)

Gets a list of runs for a specified thread.

PagedIterable<ThreadRun> listRuns(String threadId, Integer limit, ListSortOrder order, String after, String before)

Gets a list of runs for a specified thread.

PagedIterable<BinaryData> listRuns(String threadId, RequestOptions requestOptions)

Gets a list of runs for a specified thread.

PagedIterable<RunStep> listRunSteps(String threadId, String runId)

Gets a list of run steps from a thread run.

PagedIterable<RunStep> listRunSteps(String threadId, String runId, List<RunAdditionalFieldList> include, Integer limit, ListSortOrder order, String after, String before)

Gets a list of run steps from a thread run.

PagedIterable<BinaryData> listRunSteps(String threadId, String runId, RequestOptions requestOptions)

Gets a list of run steps from a thread run.

ThreadRun submitToolOutputsToRun(String threadId, String runId, List<ToolOutput> toolOutputs)

Submits outputs from tools as requested by tool calls in a run.

ThreadRun submitToolOutputsToRun(String threadId, String runId, List<ToolOutput> toolOutputs, Boolean stream)

Submits outputs from tools as requested by tool calls in a run.

Stream<StreamUpdate> submitToolOutputsToRunStreaming(String threadId, String runId, List<ToolOutput> toolOutputs)

Submits outputs from tools as requested by tool calls in a run with streaming updates.

Response<BinaryData> submitToolOutputsToRunWithResponse(String threadId, String runId, BinaryData submitToolOutputsToRunRequest, RequestOptions requestOptions)

Submits outputs from tools as requested by tool calls in a run.

ThreadRun updateRun(String threadId, String runId)

Modifies an existing thread run.

ThreadRun updateRun(String threadId, String runId, Map<String,String> metadata)

Modifies an existing thread run.

Response<BinaryData> updateRunWithResponse(String threadId, String runId, BinaryData updateRunRequest, RequestOptions requestOptions)

Modifies an existing thread run.

Methods inherited from java.lang.Object

Method Details

cancelRun

public ThreadRun cancelRun(String threadId, String runId)

Cancels a run of an in‐progress thread.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.

Returns:

data representing a single evaluation run of an agent thread.

cancelRunWithResponse

public Response<BinaryData> cancelRunWithResponse(String threadId, String runId, RequestOptions requestOptions)

Cancels a run of an in‐progress thread.

Response Body Schema

{
     id: String (Required)
     object: String (Required)
     thread_id: String (Required)
     assistant_id: String (Required)
     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
     required_action (Optional): {
         type: String (Required)
     }
     last_error (Required): {
         code: String (Required)
         message: String (Required)
     }
     model: String (Required)
     instructions: String (Required)
     tools (Required): [
          (Required){
             type: String (Required)
         }
     ]
     created_at: long (Required)
     expires_at: Long (Required)
     started_at: Long (Required)
     completed_at: Long (Required)
     cancelled_at: Long (Required)
     failed_at: Long (Required)
     incomplete_details (Required): {
         reason: String(max_completion_tokens/max_prompt_tokens) (Required)
     }
     usage (Required): {
         completion_tokens: long (Required)
         prompt_tokens: long (Required)
         total_tokens: long (Required)
     }
     temperature: Double (Optional)
     top_p: Double (Optional)
     max_prompt_tokens: Integer (Required)
     max_completion_tokens: Integer (Required)
     truncation_strategy (Required): {
         type: String(auto/last_messages) (Required)
         last_messages: Integer (Optional)
     }
     tool_choice: BinaryData (Required)
     response_format: BinaryData (Required)
     metadata (Required): {
         String: String (Required)
     }
     tool_resources (Optional): {
         code_interpreter (Optional): {
             file_ids (Optional): [
                 String (Optional)
             ]
             data_sources (Optional): [
                  (Optional){
                     uri: String (Required)
                     type: String(uri_asset/id_asset) (Required)
                 }
             ]
         }
         file_search (Optional): {
             vector_store_ids (Optional): [
                 String (Optional)
             ]
             vector_stores (Optional): [
                  (Optional){
                     name: String (Required)
                     configuration (Required): {
                         data_sources (Required): [
                             (recursive schema, see above)
                         ]
                     }
                 }
             ]
         }
         azure_ai_search (Optional): {
             indexes (Optional): [
                  (Optional){
                     index_connection_id: String (Optional)
                     index_name: String (Optional)
                     query_type: String(simple/semantic/vector/vector_simple_hybrid/vector_semantic_hybrid) (Optional)
                     top_k: Integer (Optional)
                     filter: String (Optional)
                     index_asset_id: String (Optional)
                 }
             ]
         }
     }
     parallel_tool_calls: boolean (Required)
 }

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

data representing a single evaluation run of an agent thread along with Response<T>.

createRun

public ThreadRun createRun(CreateRunOptions options)

Creates a new run for an agent thread.

Parameters:

options - Options for createRun API.

Returns:

data representing a single evaluation run of an agent thread.

createRunStreaming

public Stream<StreamUpdate> createRunStreaming(CreateRunOptions options)

Creates a new streaming run for an agent thread.

Parameters:

options - Options for createRun API.

Returns:

data representing a single evaluation run of an agent thread.

createRunWithResponse

public Response<BinaryData> createRunWithResponse(String threadId, BinaryData createRunRequest, RequestOptions requestOptions)

Creates a new run for an agent thread.

Query Parameters

| ----------- | ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name        | Type         | Required | Description                                                                                                                                                                                                                                        |
| include\[\] | List<String> | No       | A list of additional fields to include in the response. Currently the only supported value is \`step\_details.tool\_calls\[\*\].file\_search.results\[\*\].content\` to fetch the file search result content. In the form of "," separated string. |

You can add these to a request with RequestOptions#addQueryParam

Request Body Schema

{
     assistant_id: String (Required)
     model: String (Optional)
     instructions: String (Optional)
     additional_instructions: String (Optional)
     additional_messages (Optional): [
          (Optional){
             role: String(user/assistant) (Required)
             content: BinaryData (Required)
             attachments (Optional): [
                  (Optional){
                     file_id: String (Optional)
                     data_source (Optional): {
                         uri: String (Required)
                         type: String(uri_asset/id_asset) (Required)
                     }
                     tools (Required): [
                         BinaryData (Required)
                     ]
                 }
             ]
             metadata (Optional): {
                 String: String (Required)
             }
         }
     ]
     tools (Optional): [
          (Optional){
             type: String (Required)
         }
     ]
     stream: Boolean (Optional)
     temperature: Double (Optional)
     top_p: Double (Optional)
     max_prompt_tokens: Integer (Optional)
     max_completion_tokens: Integer (Optional)
     truncation_strategy (Optional): {
         type: String(auto/last_messages) (Required)
         last_messages: Integer (Optional)
     }
     tool_choice: BinaryData (Optional)
     response_format: BinaryData (Optional)
     parallel_tool_calls: Boolean (Optional)
     metadata (Optional): {
         String: String (Required)
     }
 }

Response Body Schema

{
     id: String (Required)
     object: String (Required)
     thread_id: String (Required)
     assistant_id: String (Required)
     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
     required_action (Optional): {
         type: String (Required)
     }
     last_error (Required): {
         code: String (Required)
         message: String (Required)
     }
     model: String (Required)
     instructions: String (Required)
     tools (Required): [
          (Required){
             type: String (Required)
         }
     ]
     created_at: long (Required)
     expires_at: Long (Required)
     started_at: Long (Required)
     completed_at: Long (Required)
     cancelled_at: Long (Required)
     failed_at: Long (Required)
     incomplete_details (Required): {
         reason: String(max_completion_tokens/max_prompt_tokens) (Required)
     }
     usage (Required): {
         completion_tokens: long (Required)
         prompt_tokens: long (Required)
         total_tokens: long (Required)
     }
     temperature: Double (Optional)
     top_p: Double (Optional)
     max_prompt_tokens: Integer (Required)
     max_completion_tokens: Integer (Required)
     truncation_strategy (Required): {
         type: String(auto/last_messages) (Required)
         last_messages: Integer (Optional)
     }
     tool_choice: BinaryData (Required)
     response_format: BinaryData (Required)
     metadata (Required): {
         String: String (Required)
     }
     tool_resources (Optional): {
         code_interpreter (Optional): {
             file_ids (Optional): [
                 String (Optional)
             ]
             data_sources (Optional): [
                  (Optional){
                     uri: String (Required)
                     type: String(uri_asset/id_asset) (Required)
                 }
             ]
         }
         file_search (Optional): {
             vector_store_ids (Optional): [
                 String (Optional)
             ]
             vector_stores (Optional): [
                  (Optional){
                     name: String (Required)
                     configuration (Required): {
                         data_sources (Required): [
                             (recursive schema, see above)
                         ]
                     }
                 }
             ]
         }
         azure_ai_search (Optional): {
             indexes (Optional): [
                  (Optional){
                     index_connection_id: String (Optional)
                     index_name: String (Optional)
                     query_type: String(simple/semantic/vector/vector_simple_hybrid/vector_semantic_hybrid) (Optional)
                     top_k: Integer (Optional)
                     filter: String (Optional)
                     index_asset_id: String (Optional)
                 }
             ]
         }
     }
     parallel_tool_calls: boolean (Required)
 }

Parameters:

threadId - Identifier of the thread.
createRunRequest - The createRunRequest parameter.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

data representing a single evaluation run of an agent thread along with Response<T>.

getRun

public ThreadRun getRun(String threadId, String runId)

Gets an existing run from an existing thread.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.

Returns:

an existing run from an existing thread.

getRunStep

public RunStep getRunStep(String threadId, String runId, String stepId)

Retrieves a single run step from a thread run.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
stepId - Identifier of the run step.

Returns:

detailed information about a single step of an agent thread run.

getRunStep

public RunStep getRunStep(String threadId, String runId, String stepId, List<RunAdditionalFieldList> include)

Retrieves a single run step from a thread run.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
stepId - Identifier of the run step.
include - A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[*].file_search.results[*].content to fetch the file search result content.

Returns:

detailed information about a single step of an agent thread run.

getRunStepWithResponse

public Response<BinaryData> getRunStepWithResponse(String threadId, String runId, String stepId, RequestOptions requestOptions)

Retrieves a single run step from a thread run.

Query Parameters

| ----------- | ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name        | Type         | Required | Description                                                                                                                                                                                                                                        |
| include\[\] | List<String> | No       | A list of additional fields to include in the response. Currently the only supported value is \`step\_details.tool\_calls\[\*\].file\_search.results\[\*\].content\` to fetch the file search result content. In the form of "," separated string. |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     id: String (Required)
     object: String (Required)
     type: String(message_creation/tool_calls) (Required)
     assistant_id: String (Required)
     thread_id: String (Required)
     run_id: String (Required)
     status: String(in_progress/cancelled/failed/completed/expired) (Required)
     step_details (Required): {
         type: String(message_creation/tool_calls) (Required)
     }
     last_error (Required): {
         code: String(server_error/rate_limit_exceeded) (Required)
         message: String (Required)
     }
     created_at: long (Required)
     expired_at: Long (Required)
     completed_at: Long (Required)
     cancelled_at: Long (Required)
     failed_at: Long (Required)
     usage (Optional): {
         completion_tokens: long (Required)
         prompt_tokens: long (Required)
         total_tokens: long (Required)
     }
     metadata (Required): {
         String: String (Required)
     }
 }

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
stepId - Identifier of the run step.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

detailed information about a single step of an agent thread run along with Response<T>.

getRunWithResponse

public Response<BinaryData> getRunWithResponse(String threadId, String runId, RequestOptions requestOptions)

Gets an existing run from an existing thread.

Response Body Schema

{
     id: String (Required)
     object: String (Required)
     thread_id: String (Required)
     assistant_id: String (Required)
     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
     required_action (Optional): {
         type: String (Required)
     }
     last_error (Required): {
         code: String (Required)
         message: String (Required)
     }
     model: String (Required)
     instructions: String (Required)
     tools (Required): [
          (Required){
             type: String (Required)
         }
     ]
     created_at: long (Required)
     expires_at: Long (Required)
     started_at: Long (Required)
     completed_at: Long (Required)
     cancelled_at: Long (Required)
     failed_at: Long (Required)
     incomplete_details (Required): {
         reason: String(max_completion_tokens/max_prompt_tokens) (Required)
     }
     usage (Required): {
         completion_tokens: long (Required)
         prompt_tokens: long (Required)
         total_tokens: long (Required)
     }
     temperature: Double (Optional)
     top_p: Double (Optional)
     max_prompt_tokens: Integer (Required)
     max_completion_tokens: Integer (Required)
     truncation_strategy (Required): {
         type: String(auto/last_messages) (Required)
         last_messages: Integer (Optional)
     }
     tool_choice: BinaryData (Required)
     response_format: BinaryData (Required)
     metadata (Required): {
         String: String (Required)
     }
     tool_resources (Optional): {
         code_interpreter (Optional): {
             file_ids (Optional): [
                 String (Optional)
             ]
             data_sources (Optional): [
                  (Optional){
                     uri: String (Required)
                     type: String(uri_asset/id_asset) (Required)
                 }
             ]
         }
         file_search (Optional): {
             vector_store_ids (Optional): [
                 String (Optional)
             ]
             vector_stores (Optional): [
                  (Optional){
                     name: String (Required)
                     configuration (Required): {
                         data_sources (Required): [
                             (recursive schema, see above)
                         ]
                     }
                 }
             ]
         }
         azure_ai_search (Optional): {
             indexes (Optional): [
                  (Optional){
                     index_connection_id: String (Optional)
                     index_name: String (Optional)
                     query_type: String(simple/semantic/vector/vector_simple_hybrid/vector_semantic_hybrid) (Optional)
                     top_k: Integer (Optional)
                     filter: String (Optional)
                     index_asset_id: String (Optional)
                 }
             ]
         }
     }
     parallel_tool_calls: boolean (Required)
 }

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

an existing run from an existing thread along with Response<T>.

listRuns

public PagedIterable<ThreadRun> listRuns(String threadId)

Gets a list of runs for a specified thread.

Parameters:

threadId - Identifier of the thread.

Returns:

a list of runs for a specified thread as paginated response with PagedIterable<T>.

listRuns

public PagedIterable<ThreadRun> listRuns(String threadId, Integer limit, ListSortOrder order, String after, String before)

Gets a list of runs for a specified thread.

Parameters:

threadId - Identifier of the thread.
limit - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
order - Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
after - A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
before - A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Returns:

a list of runs for a specified thread as paginated response with PagedIterable<T>.

listRuns

public PagedIterable<BinaryData> listRuns(String threadId, RequestOptions requestOptions)

Gets a list of runs for a specified thread.

Query Parameters

| ------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name   | Type    | Required | Description                                                                                                                                                                                                                                                                           |
| limit  | Integer | No       | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.                                                                                                                                                                            |
| order  | String  | No       | Sort order by the created\_at timestamp of the objects. asc for ascending order and desc for descending order. Allowed values: "asc", "desc".                                                                                                                                         |
| after  | String  | No       | A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj\_foo, your subsequent call can include after=obj\_foo in order to fetch the next page of the list.       |
| before | String  | No       | A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj\_foo, your subsequent call can include before=obj\_foo in order to fetch the previous page of the list. |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     id: String (Required)
     object: String (Required)
     thread_id: String (Required)
     assistant_id: String (Required)
     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
     required_action (Optional): {
         type: String (Required)
     }
     last_error (Required): {
         code: String (Required)
         message: String (Required)
     }
     model: String (Required)
     instructions: String (Required)
     tools (Required): [
          (Required){
             type: String (Required)
         }
     ]
     created_at: long (Required)
     expires_at: Long (Required)
     started_at: Long (Required)
     completed_at: Long (Required)
     cancelled_at: Long (Required)
     failed_at: Long (Required)
     incomplete_details (Required): {
         reason: String(max_completion_tokens/max_prompt_tokens) (Required)
     }
     usage (Required): {
         completion_tokens: long (Required)
         prompt_tokens: long (Required)
         total_tokens: long (Required)
     }
     temperature: Double (Optional)
     top_p: Double (Optional)
     max_prompt_tokens: Integer (Required)
     max_completion_tokens: Integer (Required)
     truncation_strategy (Required): {
         type: String(auto/last_messages) (Required)
         last_messages: Integer (Optional)
     }
     tool_choice: BinaryData (Required)
     response_format: BinaryData (Required)
     metadata (Required): {
         String: String (Required)
     }
     tool_resources (Optional): {
         code_interpreter (Optional): {
             file_ids (Optional): [
                 String (Optional)
             ]
             data_sources (Optional): [
                  (Optional){
                     uri: String (Required)
                     type: String(uri_asset/id_asset) (Required)
                 }
             ]
         }
         file_search (Optional): {
             vector_store_ids (Optional): [
                 String (Optional)
             ]
             vector_stores (Optional): [
                  (Optional){
                     name: String (Required)
                     configuration (Required): {
                         data_sources (Required): [
                             (recursive schema, see above)
                         ]
                     }
                 }
             ]
         }
         azure_ai_search (Optional): {
             indexes (Optional): [
                  (Optional){
                     index_connection_id: String (Optional)
                     index_name: String (Optional)
                     query_type: String(simple/semantic/vector/vector_simple_hybrid/vector_semantic_hybrid) (Optional)
                     top_k: Integer (Optional)
                     filter: String (Optional)
                     index_asset_id: String (Optional)
                 }
             ]
         }
     }
     parallel_tool_calls: boolean (Required)
 }

Parameters:

threadId - Identifier of the thread.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

a list of runs for a specified thread as paginated response with PagedIterable<T>.

listRunSteps

public PagedIterable<RunStep> listRunSteps(String threadId, String runId)

Gets a list of run steps from a thread run.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.

Returns:

a list of run steps from a thread run as paginated response with PagedIterable<T>.

listRunSteps

public PagedIterable<RunStep> listRunSteps(String threadId, String runId, List<RunAdditionalFieldList> include, Integer limit, ListSortOrder order, String after, String before)

Gets a list of run steps from a thread run.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
include - A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[*].file_search.results[*].content to fetch the file search result content.
limit - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
order - Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
after - A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
before - A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Returns:

a list of run steps from a thread run as paginated response with PagedIterable<T>.

listRunSteps

public PagedIterable<BinaryData> listRunSteps(String threadId, String runId, RequestOptions requestOptions)

Gets a list of run steps from a thread run.

Query Parameters

| ----------- | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name        | Type         | Required | Description                                                                                                                                                                                                                                                                           |
| include\[\] | List<String> | No       | A list of additional fields to include in the response. Currently the only supported value is \`step\_details.tool\_calls\[\*\].file\_search.results\[\*\].content\` to fetch the file search result content. In the form of "," separated string.                                    |
| limit       | Integer      | No       | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.                                                                                                                                                                            |
| order       | String       | No       | Sort order by the created\_at timestamp of the objects. asc for ascending order and desc for descending order. Allowed values: "asc", "desc".                                                                                                                                         |
| after       | String       | No       | A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj\_foo, your subsequent call can include after=obj\_foo in order to fetch the next page of the list.       |
| before      | String       | No       | A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj\_foo, your subsequent call can include before=obj\_foo in order to fetch the previous page of the list. |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     id: String (Required)
     object: String (Required)
     type: String(message_creation/tool_calls) (Required)
     assistant_id: String (Required)
     thread_id: String (Required)
     run_id: String (Required)
     status: String(in_progress/cancelled/failed/completed/expired) (Required)
     step_details (Required): {
         type: String(message_creation/tool_calls) (Required)
     }
     last_error (Required): {
         code: String(server_error/rate_limit_exceeded) (Required)
         message: String (Required)
     }
     created_at: long (Required)
     expired_at: Long (Required)
     completed_at: Long (Required)
     cancelled_at: Long (Required)
     failed_at: Long (Required)
     usage (Optional): {
         completion_tokens: long (Required)
         prompt_tokens: long (Required)
         total_tokens: long (Required)
     }
     metadata (Required): {
         String: String (Required)
     }
 }

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

a list of run steps from a thread run as paginated response with PagedIterable<T>.

submitToolOutputsToRun

public ThreadRun submitToolOutputsToRun(String threadId, String runId, List<ToolOutput> toolOutputs)

Submits outputs from tools as requested by tool calls in a run.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
toolOutputs - A list of tools for which the outputs are being submitted.

Returns:

data representing a single evaluation run of an agent thread.

submitToolOutputsToRun

public ThreadRun submitToolOutputsToRun(String threadId, String runId, List<ToolOutput> toolOutputs, Boolean stream)

Submits outputs from tools as requested by tool calls in a run.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
toolOutputs - A list of tools for which the outputs are being submitted.
stream - If true, returns a stream of events that happen during the Run as SSE, terminating at [DONE].

Returns:

data representing a single evaluation run of an agent thread.

submitToolOutputsToRunStreaming

public Stream<StreamUpdate> submitToolOutputsToRunStreaming(String threadId, String runId, List<ToolOutput> toolOutputs)

Submits outputs from tools as requested by tool calls in a run with streaming updates. Runs that need submitted tool outputs will have a status of 'requires_action' with a required_action.type of 'submit_tool_outputs'.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
toolOutputs - A list of tools for which the outputs are being submitted.

Returns:

data representing a single evaluation run of an agent thread.

submitToolOutputsToRunWithResponse

public Response<BinaryData> submitToolOutputsToRunWithResponse(String threadId, String runId, BinaryData submitToolOutputsToRunRequest, RequestOptions requestOptions)

Submits outputs from tools as requested by tool calls in a run.

Request Body Schema

{
     tool_outputs (Required): [
          (Required){
             tool_call_id: String (Optional)
             output: String (Optional)
         }
     ]
     stream: Boolean (Optional)
 }

Response Body Schema

{
     id: String (Required)
     object: String (Required)
     thread_id: String (Required)
     assistant_id: String (Required)
     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
     required_action (Optional): {
         type: String (Required)
     }
     last_error (Required): {
         code: String (Required)
         message: String (Required)
     }
     model: String (Required)
     instructions: String (Required)
     tools (Required): [
          (Required){
             type: String (Required)
         }
     ]
     created_at: long (Required)
     expires_at: Long (Required)
     started_at: Long (Required)
     completed_at: Long (Required)
     cancelled_at: Long (Required)
     failed_at: Long (Required)
     incomplete_details (Required): {
         reason: String(max_completion_tokens/max_prompt_tokens) (Required)
     }
     usage (Required): {
         completion_tokens: long (Required)
         prompt_tokens: long (Required)
         total_tokens: long (Required)
     }
     temperature: Double (Optional)
     top_p: Double (Optional)
     max_prompt_tokens: Integer (Required)
     max_completion_tokens: Integer (Required)
     truncation_strategy (Required): {
         type: String(auto/last_messages) (Required)
         last_messages: Integer (Optional)
     }
     tool_choice: BinaryData (Required)
     response_format: BinaryData (Required)
     metadata (Required): {
         String: String (Required)
     }
     tool_resources (Optional): {
         code_interpreter (Optional): {
             file_ids (Optional): [
                 String (Optional)
             ]
             data_sources (Optional): [
                  (Optional){
                     uri: String (Required)
                     type: String(uri_asset/id_asset) (Required)
                 }
             ]
         }
         file_search (Optional): {
             vector_store_ids (Optional): [
                 String (Optional)
             ]
             vector_stores (Optional): [
                  (Optional){
                     name: String (Required)
                     configuration (Required): {
                         data_sources (Required): [
                             (recursive schema, see above)
                         ]
                     }
                 }
             ]
         }
         azure_ai_search (Optional): {
             indexes (Optional): [
                  (Optional){
                     index_connection_id: String (Optional)
                     index_name: String (Optional)
                     query_type: String(simple/semantic/vector/vector_simple_hybrid/vector_semantic_hybrid) (Optional)
                     top_k: Integer (Optional)
                     filter: String (Optional)
                     index_asset_id: String (Optional)
                 }
             ]
         }
     }
     parallel_tool_calls: boolean (Required)
 }

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
submitToolOutputsToRunRequest - The submitToolOutputsToRunRequest parameter.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

data representing a single evaluation run of an agent thread along with Response<T>.

updateRun

public ThreadRun updateRun(String threadId, String runId)

Modifies an existing thread run.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.

Returns:

data representing a single evaluation run of an agent thread.

updateRun

public ThreadRun updateRun(String threadId, String runId, Map<String,String> metadata)

Modifies an existing thread run.

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
metadata - A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.

Returns:

data representing a single evaluation run of an agent thread.

updateRunWithResponse

public Response<BinaryData> updateRunWithResponse(String threadId, String runId, BinaryData updateRunRequest, RequestOptions requestOptions)

Modifies an existing thread run.

Request Body Schema

{
     metadata (Optional): {
         String: String (Required)
     }
 }

Response Body Schema

{
     id: String (Required)
     object: String (Required)
     thread_id: String (Required)
     assistant_id: String (Required)
     status: String(queued/in_progress/requires_action/cancelling/cancelled/failed/completed/expired) (Required)
     required_action (Optional): {
         type: String (Required)
     }
     last_error (Required): {
         code: String (Required)
         message: String (Required)
     }
     model: String (Required)
     instructions: String (Required)
     tools (Required): [
          (Required){
             type: String (Required)
         }
     ]
     created_at: long (Required)
     expires_at: Long (Required)
     started_at: Long (Required)
     completed_at: Long (Required)
     cancelled_at: Long (Required)
     failed_at: Long (Required)
     incomplete_details (Required): {
         reason: String(max_completion_tokens/max_prompt_tokens) (Required)
     }
     usage (Required): {
         completion_tokens: long (Required)
         prompt_tokens: long (Required)
         total_tokens: long (Required)
     }
     temperature: Double (Optional)
     top_p: Double (Optional)
     max_prompt_tokens: Integer (Required)
     max_completion_tokens: Integer (Required)
     truncation_strategy (Required): {
         type: String(auto/last_messages) (Required)
         last_messages: Integer (Optional)
     }
     tool_choice: BinaryData (Required)
     response_format: BinaryData (Required)
     metadata (Required): {
         String: String (Required)
     }
     tool_resources (Optional): {
         code_interpreter (Optional): {
             file_ids (Optional): [
                 String (Optional)
             ]
             data_sources (Optional): [
                  (Optional){
                     uri: String (Required)
                     type: String(uri_asset/id_asset) (Required)
                 }
             ]
         }
         file_search (Optional): {
             vector_store_ids (Optional): [
                 String (Optional)
             ]
             vector_stores (Optional): [
                  (Optional){
                     name: String (Required)
                     configuration (Required): {
                         data_sources (Required): [
                             (recursive schema, see above)
                         ]
                     }
                 }
             ]
         }
         azure_ai_search (Optional): {
             indexes (Optional): [
                  (Optional){
                     index_connection_id: String (Optional)
                     index_name: String (Optional)
                     query_type: String(simple/semantic/vector/vector_simple_hybrid/vector_semantic_hybrid) (Optional)
                     top_k: Integer (Optional)
                     filter: String (Optional)
                     index_asset_id: String (Optional)
                 }
             ]
         }
     }
     parallel_tool_calls: boolean (Required)
 }

Parameters:

threadId - Identifier of the thread.
runId - Identifier of the run.
updateRunRequest - The updateRunRequest parameter.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

data representing a single evaluation run of an agent thread along with Response<T>.

Applies to