=encoding utf8

=head1 NAME

OpenAPI::Client::OpenAI::Path::threads - Documentation for the /threads path.

=head1 OPERATIONS

=head2 POST /threads

=head3 createThread

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

Create a thread.

=head4 Request body

Content-Type: application/json

Example:

    {
       "created_at" : 1699012949,
       "id" : "thread_abc123",
       "metadata" : {},
       "object" : "thread",
       "tool_resources" : {}
    }

=head4 Responses

B<200 - OK>

Content-Type: application/json

Example:

    {
       "created_at" : 1699012949,
       "id" : "thread_abc123",
       "metadata" : {},
       "object" : "thread",
       "tool_resources" : {}
    }

=head1 SCHEMAS

=head2 CreateMessageRequest

Properties:

=over

=item * C<attachments> (anyOf)

=item * C<content> (oneOf, required)

=item * C<metadata> (Metadata)

See L</Metadata> below for shape.

=item * C<role> (string, required) - The role of the entity that is creating the message. Allowed values include: -
C<user> : Indicates the message is sent by an actual user and should be used
in most cases to represent user-generated messages. - C<assistant> : Indicates
the message is generated by the assistant. Use this value to insert messages
from the assistant into the conversation.

Allowed values: user, assistant

=back

=head2 CreateThreadRequest

Properties:

=over

=item * C<messages> (array of CreateMessageRequest) - A list of L<messages|https://platform.openai.com/docs/api-reference/messages>
to start the thread with.

=item * C<metadata> (Metadata)

See L</Metadata> below for shape.

=item * C<tool_resources> (anyOf)

=back

=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 ThreadObject

Properties:

=over

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

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

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

See L</Metadata> below for shape.

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

Allowed values: thread

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

=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
