Skip to main content

run_steps

Creates, updates, deletes, gets or lists a run_steps resource.

Overview

Namerun_steps
TypeResource
Idazure.ai_agents.run_steps

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier, which can be referenced in API endpoints. Required.
assistant_idstringThe ID of the agent associated with the run step. Required.
run_idstringThe ID of the run that this run step is a part of. Required.
thread_idstringThe ID of the thread that was run. Required.
cancelled_atstring (date-time)The Unix timestamp, in seconds, representing when this was cancelled. Required.
completed_atstring (date-time)The Unix timestamp, in seconds, representing when this completed. Required.
created_atstring (date-time)The Unix timestamp, in seconds, representing when this object was created. Required.
expired_atstring (date-time)The Unix timestamp, in seconds, representing when this item expired. Required.
failed_atstring (date-time)The Unix timestamp, in seconds, representing when this failed. Required.
last_errorobjectIf applicable, information about the last error encountered by this run step. Required.
metadataobjectA 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. Required.
objectstringThe object type, which is always 'thread.run.step'. Required. Default value is "thread.run.step".
statusstringThe status of this run step. Required. Known values are: "in_progress", "cancelled", "failed", "completed", and "expired". (in_progress, cancelled, failed, completed, expired)
step_detailsobjectThe details for this run step. Required.
typestringThe type of run step, which can be either message_creation or tool_calls. Required. Known values are: "message_creation", "tool_calls", and "activities". (message_creation, tool_calls, activities)
usageobjectUsage statistics related to the run step. This value will be null while the run step's status is in_progress.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectthread_id, run_id, step_id, endpointinclude[]Retrieves a single run step from a thread run.
listselectthread_id, run_id, endpointinclude[], limit, order, after, beforeGets a list of run steps from a thread run.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: )
run_idstringIdentifier of the run. Required.
step_idstringIdentifier of the run step. Required.
thread_idstringIdentifier of the thread. Required.
afterstring
beforestringA 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. Default value is None.
include[]arrayA 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. Default value is None.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Default value is None.
orderstringSort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Known values are: "asc" and "desc". Default value is None.

SELECT examples

Retrieves a single run step from a thread run.

SELECT
id,
assistant_id,
run_id,
thread_id,
cancelled_at,
completed_at,
created_at,
expired_at,
failed_at,
last_error,
metadata,
object,
status,
step_details,
type,
usage
FROM azure.ai_agents.run_steps
WHERE thread_id = '{{ thread_id }}' -- required
AND run_id = '{{ run_id }}' -- required
AND step_id = '{{ step_id }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND include[] = '{{ include[] }}'
;