=encoding utf8

=head1 NAME

OpenAPI::Client::OpenAI::Path::threads-thread_id-runs-run_id-steps-step_id - Documentation for the /threads/{thread_id}/runs/{run_id}/steps/{step_id} path.

=head1 OPERATIONS

=head2 GET /threads/{thread_id}/runs/{run_id}/steps/{step_id}

=head3 getRunStep

  $client->get_run_step({
      body => { ... },
  });

Retrieves a run step.

=head4 Path/query parameters

=over

=item * C<thread_id> (in path, required, string) - The ID of the thread to which the run and run step belongs.

=item * C<run_id> (in path, required, string) - The ID of the run to which the run step belongs.

=item * C<step_id> (in path, required, string) - The ID of the run step to retrieve.

=item * C<include[]> (in query, optional, array) - A list of additional fields to include in the response. Currently the only
supported value is
C<step_details.tool_calls[I<].file_search.results[>].content> to fetch the
file search result content.

See the
L<file search tool documentation|https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings>
for more information.

=back

=head4 Responses

B<200 - OK>

Content-Type: application/json

Example:

    {
       "assistant_id" : "asst_abc123",
       "cancelled_at" : null,
       "completed_at" : 1699063291,
       "created_at" : 1699063291,
       "expired_at" : null,
       "failed_at" : null,
       "id" : "step_abc123",
       "last_error" : null,
       "object" : "thread.run.step",
       "run_id" : "run_abc123",
       "status" : "completed",
       "step_details" : {
          "message_creation" : {
             "message_id" : "msg_abc123"
          },
          "type" : "message_creation"
       },
       "thread_id" : "thread_abc123",
       "type" : "message_creation",
       "usage" : {
          "completion_tokens" : 456,
          "prompt_tokens" : 123,
          "total_tokens" : 579
       }
    }

=head1 SCHEMAS

=head2 Metadata

Set of 16 key-value pairs that can be attached to an object. This can be
useful for storing additional information about the object in a structured
format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.

=head2 RunStepCompletionUsage

Usage statistics related to the run step. This value will be C<null> while the
run step's status is C<in_progress> .

=head2 RunStepObject

Properties:

=over

=item * C<assistant_id> (string, required) - The ID of the
L<assistant|https://platform.openai.com/docs/api-reference/assistants>
associated with the run step.

=item * C<cancelled_at> (anyOf, required)

=item * C<completed_at> (anyOf, required)

=item * C<created_at> (integer, required) - The Unix timestamp (in seconds) for when the run step was created.

=item * C<expired_at> (anyOf, required)

=item * C<failed_at> (anyOf, required)

=item * C<id> (string, required) - The identifier of the run step, which can be referenced in API endpoints.

=item * C<last_error> (anyOf, required)

=item * C<metadata> (Metadata, required)

See L</Metadata> below for shape.

=item * C<object> (string, required) - The object type, which is always C<thread.run.step> .

Allowed values: thread.run.step

=item * C<run_id> (string, required) - The ID of the L<run|https://platform.openai.com/docs/api-reference/runs> that
this run step is a part of.

=item * C<status> (string, required) - The status of the run step, which can be either C<in_progress> , C<cancelled>
, C<failed> , C<completed> , or C<expired> .

Allowed values: in_progress, cancelled, failed, completed, expired

=item * C<step_details> (object, required) - The details of the run step.

=item * C<thread_id> (string, required) - The ID of the L<thread|https://platform.openai.com/docs/api-reference/threads>
that was run.

=item * C<type> (string, required) - The type of run step, which can be either C<message_creation> or C<tool_calls>
.

Allowed values: message_creation, tool_calls

=item * C<usage> (RunStepCompletionUsage, required)

See L</RunStepCompletionUsage> below for shape.

=back

=head1 SEE ALSO

L<OpenAPI::Client::OpenAI::Path>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2023-2026 by Nelson Ferraz

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.14.0 or,
at your option, any later version of Perl 5 you may have available.

=cut
