specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-08-01-preview/inference.yaml [5896:6694]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        response_format:
          $ref: "#/components/schemas/assistantsApiResponseFormatOption"
          nullable: true
      required:
        - thread_id
        - assistant_id

    threadObject:
      type: object
      title: Thread
      description: Represents a thread that contains [messages](/docs/api-reference/messages).
      properties:
        id:
          description: The identifier, which can be referenced in API endpoints.
          type: string
        object:
          description: The object type, which is always `thread`.
          type: string
          enum:
            - thread
          x-ms-enum:
            name: ThreadObjectType
            modelAsString: true
            values:
              - value: thread
                description: The type of thread object which is always `thread`
        created_at:
          description: The Unix timestamp (in seconds) for when the thread was created.
          type: integer
        tool_resources:
          type: object
          description: |
            A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
          properties:
            code_interpreter:
              type: object
              properties:
                file_ids:
                  type: array
                  description: |
                    A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.
                  default: []
                  maxItems: 20
                  items:
                    type: string
            file_search:
              type: object
              properties:
                vector_store_ids:
                  type: array
                  description: |
                    The vector store attached to this thread. There can be a maximum of 1 vector store attached to the thread.
                  maxItems: 1
                  items:
                    type: string
          nullable: true
        metadata:
          description: *metadata_description
          type: object
          nullable: true
      required:
        - id
        - object
        - created_at
        - tool_resources
        - metadata

    createThreadRequest:
      type: object
      additionalProperties: false
      properties:
        messages:
          description: A list of messages to start the thread with.
          type: array
          items:
            $ref: "#/components/schemas/createMessageRequest"
        tool_resources:
          type: object
          description: |
            A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
          properties:
            code_interpreter:
              type: object
              properties:
                file_ids:
                  type: array
                  description: |
                    A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.
                  default: []
                  maxItems: 20
                  items:
                    type: string
            file_search:
              type: object
              properties:
                vector_store_ids:
                  type: array
                  description: |
                    The vector store attached to this thread. There can be a maximum of 1 vector store attached to the thread.
                  maxItems: 1
                  items:
                    type: string
                vector_stores:
                  type: array
                  description: |
                    A helper to create a vector store with file_ids and attach it to this thread. There can be a maximum of 1 vector store attached to the thread.
                  maxItems: 1
                  items:
                    type: object
                    properties:
                      file_ids:
                        type: array
                        description: |
                          A list of file IDs to add to the vector store. There can be a maximum of 10000 files in a vector store.
                        maxItems: 10000
                        items:
                          type: string
                      chunking_strategy:
                        # Ideally we'd reuse the chunking strategy schema here, but it doesn't expand properly
                        type: object
                        description: The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy.
                        oneOf:
                          - type: object
                            title: Auto Chunking Strategy
                            description: The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.
                            additionalProperties: false
                            properties:
                              type:
                                type: string
                                description: Always `auto`.
                                enum: ["auto"]
                                x-ms-enum:
                                  name: AutoChunkingStrategyType
                                  modelAsString: true
                                  values:
                                    - value: auto
                            required:
                              - type
                          - type: object
                            title: Static Chunking Strategy
                            additionalProperties: false
                            properties:
                              type:
                                type: string
                                description: Always `static`.
                                enum: ["static"]
                                x-ms-enum:
                                  name: StaticChunkingStrategyType
                                  modelAsString: true
                                  values:
                                    - value: static
                              static:
                                type: object
                                additionalProperties: false
                                properties:
                                  max_chunk_size_tokens:
                                    type: integer
                                    minimum: 100
                                    maximum: 4096
                                    description: The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
                                  chunk_overlap_tokens:
                                    type: integer
                                    description: |
                                      The number of tokens that overlap between chunks. The default value is `400`.

                                      Note that the overlap must not exceed half of `max_chunk_size_tokens`.
                                required:
                                  - max_chunk_size_tokens
                                  - chunk_overlap_tokens
                            required:
                              - type
                              - static
                      metadata:
                        type: object
                        description: |
                          Set of 16 key-value pairs that can be attached to a vector store. This can be useful for storing additional information about the vector store in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.
              oneOf:
                - required: [vector_store_ids]
                - required: [vector_stores]
          nullable: true
        metadata:
          description: *metadata_description
          type: object
          nullable: true

    modifyThreadRequest:
      type: object
      additionalProperties: false
      properties:
        tool_resources:
          type: object
          description: |
            A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
          properties:
            code_interpreter:
              type: object
              properties:
                file_ids:
                  type: array
                  description: |
                    A list of File IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.
                  default: []
                  maxItems: 20
                  items:
                    type: string
            file_search:
              type: object
              properties:
                vector_store_ids:
                  type: array
                  description: |
                    The vector store attached to this thread. There can be a maximum of 1 vector store attached to the thread.
                  maxItems: 1
                  items:
                    type: string
          nullable: true
        metadata:
          description: *metadata_description
          type: object
          nullable: true

    deleteThreadResponse:
      type: object
      properties:
        id:
          type: string
        deleted:
          type: boolean
        object:
          type: string
          enum:
            - thread.deleted
          x-ms-enum:
            name: DeleteThreadResponseObjectState
            modelAsString: true
            values:
              - value: thread.deleted
                description: The delete thread response object state which is `thread.deleted`
      required:
        - id
        - object
        - deleted

    listThreadsResponse:
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: "#/components/schemas/threadObject"
        first_id:
          type: string
          example: asst_hLBK7PXBv5Lr2NQT7KLY0ag1
        last_id:
          type: string
          example: asst_QLoItBbqwyAJEzlTy4y9kOMM
        has_more:
          type: boolean
          example: false
      required:
        - object
        - data
        - first_id
        - last_id
        - has_more

    messageObject:
      type: object
      title: The message object
      description: Represents a message within a [thread](/docs/api-reference/threads).
      properties:
        id:
          description: The identifier, which can be referenced in API endpoints.
          type: string
        object:
          description: The object type, which is always `thread.message`.
          type: string
          enum:
            - thread.message
          x-ms-enum:
            name: MessageObjectType
            modelAsString: true
            values:
              - value: thread.message
                description: The message object type which is `thread.message`
        created_at:
          description: The Unix timestamp (in seconds) for when the message was created.
          type: integer
        thread_id:
          description: The [thread](/docs/api-reference/threads) ID that this message belongs to.
          type: string
        status:
          description: The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.
          type: string
          enum: ["in_progress", "incomplete", "completed"]
          x-ms-enum:
            name: MessageObjectStatus
            modelAsString: true
            values:
              - value: in_progress
              - value: incomplete
              - value: completed
        incomplete_details:
          description: On an incomplete message, details about why the message is incomplete.
          type: object
          properties:
            reason:
              type: string
              description: The reason the message is incomplete.
              enum:
                [
                  "content_filter",
                  "max_tokens",
                  "run_cancelled",
                  "run_expired",
                  "run_failed",
                ]
              x-ms-enum:
                name: MessageObjectIncompleteReason
                modelAsString: true
                values:
                  - value: content_filter
                  - value: max_tokens
                  - value: run_cancelled
                  - value: run_expired
                  - value: run_failed
          nullable: true
          required:
            - reason
        completed_at:
          description: The Unix timestamp (in seconds) for when the message was completed.
          type: integer
          nullable: true
        incomplete_at:
          description: The Unix timestamp (in seconds) for when the message was marked as incomplete.
          type: integer
          nullable: true
        role:
          description: The entity that produced the message. One of `user` or `assistant`.
          type: string
          enum:
            - user
            - assistant
          x-ms-enum:
            name: MessageObjectRole
            modelAsString: true
            values:
              - value: user
              - value: assistant
        content:
          description: The content of the message in array of text and/or images.
          type: array
          items:
            oneOf:
              - $ref: "#/components/schemas/messageContentImageFileObject"
              - $ref: "#/components/schemas/messageContentTextObject"
        assistant_id:
          description: If applicable, the ID of the assistant that authored this message.
          type: string
          nullable: true
        run_id:
          description: If applicable, the ID of the [run](/docs/api-reference/runs) associated with the authoring of this message.
          type: string
          nullable: true
        attachments:
          type: array
          items:
            type: object
            properties:
              file_id:
                type: string
                description: The ID of the file to attach to the message.
              tools:
                description: The tools to add this file to.
                type: array
                items:
                  oneOf:
                    - $ref: "#/components/schemas/assistantToolsCode"
                    - $ref: "#/components/schemas/assistantToolsFileSearchTypeOnly"
          description: A list of files attached to the message, and the tools they were added to.
          nullable: true
        metadata:
          description: *metadata_description
          type: object
          nullable: true
      required:
        - id
        - object
        - created_at
        - thread_id
        - status
        - incomplete_details
        - completed_at
        - incomplete_at
        - role
        - content
        - assistant_id
        - run_id
        - attachments
        - metadata

    messageDeltaObject:
      type: object
      title: Message delta object
      description: |
        Represents a message delta i.e. any changed fields on a message during streaming.
      properties:
        id:
          description: The identifier of the message, which can be referenced in API endpoints.
          type: string
        object:
          description: The object type, which is always `thread.message.delta`.
          type: string
          enum: ["thread.message.delta"]
          x-ms-enum:
            name: MessageDeltaObjectType
            modelAsString: true
            values:
              - value: thread.message.delta
        delta:
          description: The delta containing the fields that have changed on the Message.
          type: object
          properties:
            role:
              description: The entity that produced the message. One of `user` or `assistant`.
              type: string
              enum: ["user", "assistant"]
              x-ms-enum:
                name: MessageDeltaObjectDeltaRole
                modelAsString: true
                values:
                  - value: user
                  - value: assistant
            content:
              description: The content of the message in array of text and/or images.
              type: array
              items:
                oneOf:
                  - $ref: "#/components/schemas/messageDeltaContentImageFileObject"
                  - $ref: "#/components/schemas/messageDeltaContentTextObject"
      required:
        - id
        - object
        - delta

    createMessageRequest:
      type: object
      additionalProperties: false
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
          x-ms-enum:
            name: CreateMessageRequestRole
            modelAsString: true
            values:
              - value: user
              - value: assistant
          description: |
            The role of the entity that is creating the message. Allowed values include:
            - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.
            - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
        content:
          type: string
          minLength: 1
          maxLength: 256000
          description: The content of the message.
        attachments:
          type: array
          items:
            type: object
            properties:
              file_id:
                type: string
                description: The ID of the file to attach to the message.
              tools:
                description: The tools to add this file to.
                type: array
                items:
                  oneOf:
                    - $ref: "#/components/schemas/assistantToolsCode"
                    - $ref: "#/components/schemas/assistantToolsFileSearchTypeOnly"
                  x-oaiExpandable: true
          description: A list of files attached to the message, and the tools they should be added to.
          required:
            - file_id
            - tools
          nullable: true
        metadata:
          description: *metadata_description
          type: object
          nullable: true
    modifyMessageRequest:
      type: object
      additionalProperties: false
      properties:
        metadata:
          description: *metadata_description
          type: object
          nullable: true
    deleteMessageResponse:
      type: object
      properties:
        id:
          type: string
        deleted:
          type: boolean
        object:
          type: string
          enum:
            - thread.message.deleted
          x-ms-enum:
            name: DeleteMessageResponseObject
            modelAsString: true
            values:
              - value: thread.message.deleted
                description: The delete message response object state
      required:
        - id
        - object
        - deleted
    listMessagesResponse:
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: "#/components/schemas/messageObject"
        first_id:
          type: string
          example: msg_hLBK7PXBv5Lr2NQT7KLY0ag1
        last_id:
          type: string
          example: msg_QLoItBbqwyAJEzlTy4y9kOMM
        has_more:
          type: boolean
          example: false
      required:
        - object
        - data
        - first_id
        - last_id
        - has_more

    messageContentImageFileObject:
      title: Image file
      type: object
      description: References an image file in the content of a message.
      properties:
        type:
          description: Always `image_file`.
          type: string
          enum:
            - image_file
          x-ms-enum:
            name: MessageContentImageFileObjectType
            modelAsString: true
            values:
              - value: image_file
                description: The message content image file type
        image_file:
          type: object
          properties:
            file_id:
              description: The file ID of the image in the message content.
              type: string
          required:
            - file_id
      required:
        - type
        - image_file

    messageContentTextObject:
      title: Text
      type: object
      description: The text content that is part of a message.
      properties:
        type:
          description: Always `text`.
          type: string
          enum:
            - text
          x-ms-enum:
            name: messageContentTextObjectType
            modelAsString: true
            values:
              - value: text
                description: The message content text Object type
        text:
          type: object
          properties:
            value:
              description: The data that makes up the text.
              type: string
            annotations:
              type: array
              items:
                oneOf:
                  - $ref: "#/components/schemas/messageContentTextAnnotationsFileCitationObject"
                  - $ref: "#/components/schemas/messageContentTextAnnotationsFilePathObject"
          required:
            - value
            - annotations
      required:
        - type
        - text

    messageContentTextAnnotationsFileCitationObject:
      title: File citation
      type: object
      description: A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "retrieval" tool to search files.
      properties:
        type:
          description: Always `file_citation`.
          type: string
          enum:
            - file_citation
          x-ms-enum:
            name: FileCitationObjectType
            modelAsString: true
            values:
              - value: file_citation
                description: The file citation object type
        text:
          description: The text in the message content that needs to be replaced.
          type: string
        file_citation:
          type: object
          properties:
            file_id:
              description: The ID of the specific File the citation is from.
              type: string
          required:
            - file_id
        start_index:
          type: integer
          minimum: 0
        end_index:
          type: integer
          minimum: 0
      required:
        - type
        - text
        - file_citation
        - start_index
        - end_index

    messageContentTextAnnotationsFilePathObject:
      title: File path
      type: object
      description: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.
      properties:
        type:
          description: Always `file_path`.
          type: string
          enum:
            - file_path
          x-ms-enum:
            name: FilePathObjectType
            modelAsString: true
            values:
              - value: file_path
                description: The file path object type
        text:
          description: The text in the message content that needs to be replaced.
          type: string
        file_path:
          type: object
          properties:
            file_id:
              description: The ID of the file that was generated.
              type: string
          required:
            - file_id
        start_index:
          type: integer
          minimum: 0
        end_index:
          type: integer
          minimum: 0
      required:
        - type
        - text
        - file_path
        - start_index
        - end_index

    messageDeltaContentImageFileObject:
      title: Image file
      type: object
      description: References an image File in the content of a message.
      properties:
        index:
          type: integer
          description: The index of the content part in the message.
        type:
          description: Always `image_file`.
          type: string
          enum: ["image_file"]
          x-ms-enum:
            name: MessageDeltaContentImageFileObjectType
            modelAsString: true
            values:
              - value: image_file
        image_file:
          type: object
          properties:
            file_id:
              description: The File ID of the image in the message content.
              type: string
      required:
        - index
        - type

    messageDeltaContentTextObject:
      title: Text
      type: object
      description: The text content that is part of a message.
      properties:
        index:
          type: integer
          description: The index of the content part in the message.
        type:
          description: Always `text`.
          type: string
          enum: ["text"]
          x-ms-enum:
            name: MessageDeltaContentTextObjectType
            modelAsString: true
            values:
              - value: text
        text:
          type: object
          properties:
            value:
              description: The data that makes up the text.
              type: string
            annotations:
              type: array
              items:
                oneOf:
                  - $ref: "#/components/schemas/messageDeltaContentTextAnnotationsFileCitationObject"
                  - $ref: "#/components/schemas/messageDeltaContentTextAnnotationsFilePathObject"
      required:
        - index
        - type

    messageDeltaContentTextAnnotationsFileCitationObject:
      title: File citation
      type: object
      description: A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
      properties:
        index:
          type: integer
          description: The index of the annotation in the text content part.
        type:
          description: Always `file_citation`.
          type: string
          enum: ["file_citation"]
          x-ms-enum:
            name: MessageDeltaContentTextAnnotationsFileCitationObjectType
            modelAsString: true
            values:
              - value: file_citation
        text:
          description: The text in the message content that needs to be replaced.
          type: string
        file_citation:
          type: object
          properties:
            file_id:
              description: The ID of the specific File the citation is from.
              type: string
            quote:
              description: The specific quote in the file.
              type: string
        start_index:
          type: integer
          minimum: 0
        end_index:
          type: integer
          minimum: 0
      required:
        - index
        - type

    messageDeltaContentTextAnnotationsFilePathObject:
      title: File path
      type: object
      description: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-10-01-preview/inference.yaml [5966:6764]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        response_format:
          $ref: "#/components/schemas/assistantsApiResponseFormatOption"
          nullable: true
      required:
        - thread_id
        - assistant_id

    threadObject:
      type: object
      title: Thread
      description: Represents a thread that contains [messages](/docs/api-reference/messages).
      properties:
        id:
          description: The identifier, which can be referenced in API endpoints.
          type: string
        object:
          description: The object type, which is always `thread`.
          type: string
          enum:
            - thread
          x-ms-enum:
            name: ThreadObjectType
            modelAsString: true
            values:
              - value: thread
                description: The type of thread object which is always `thread`
        created_at:
          description: The Unix timestamp (in seconds) for when the thread was created.
          type: integer
        tool_resources:
          type: object
          description: |
            A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
          properties:
            code_interpreter:
              type: object
              properties:
                file_ids:
                  type: array
                  description: |
                    A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.
                  default: []
                  maxItems: 20
                  items:
                    type: string
            file_search:
              type: object
              properties:
                vector_store_ids:
                  type: array
                  description: |
                    The vector store attached to this thread. There can be a maximum of 1 vector store attached to the thread.
                  maxItems: 1
                  items:
                    type: string
          nullable: true
        metadata:
          description: *metadata_description
          type: object
          nullable: true
      required:
        - id
        - object
        - created_at
        - tool_resources
        - metadata

    createThreadRequest:
      type: object
      additionalProperties: false
      properties:
        messages:
          description: A list of messages to start the thread with.
          type: array
          items:
            $ref: "#/components/schemas/createMessageRequest"
        tool_resources:
          type: object
          description: |
            A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
          properties:
            code_interpreter:
              type: object
              properties:
                file_ids:
                  type: array
                  description: |
                    A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.
                  default: []
                  maxItems: 20
                  items:
                    type: string
            file_search:
              type: object
              properties:
                vector_store_ids:
                  type: array
                  description: |
                    The vector store attached to this thread. There can be a maximum of 1 vector store attached to the thread.
                  maxItems: 1
                  items:
                    type: string
                vector_stores:
                  type: array
                  description: |
                    A helper to create a vector store with file_ids and attach it to this thread. There can be a maximum of 1 vector store attached to the thread.
                  maxItems: 1
                  items:
                    type: object
                    properties:
                      file_ids:
                        type: array
                        description: |
                          A list of file IDs to add to the vector store. There can be a maximum of 10000 files in a vector store.
                        maxItems: 10000
                        items:
                          type: string
                      chunking_strategy:
                        # Ideally we'd reuse the chunking strategy schema here, but it doesn't expand properly
                        type: object
                        description: The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy.
                        oneOf:
                          - type: object
                            title: Auto Chunking Strategy
                            description: The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.
                            additionalProperties: false
                            properties:
                              type:
                                type: string
                                description: Always `auto`.
                                enum: ["auto"]
                                x-ms-enum:
                                  name: AutoChunkingStrategyType
                                  modelAsString: true
                                  values:
                                    - value: auto
                            required:
                              - type
                          - type: object
                            title: Static Chunking Strategy
                            additionalProperties: false
                            properties:
                              type:
                                type: string
                                description: Always `static`.
                                enum: ["static"]
                                x-ms-enum:
                                  name: StaticChunkingStrategyType
                                  modelAsString: true
                                  values:
                                    - value: static
                              static:
                                type: object
                                additionalProperties: false
                                properties:
                                  max_chunk_size_tokens:
                                    type: integer
                                    minimum: 100
                                    maximum: 4096
                                    description: The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
                                  chunk_overlap_tokens:
                                    type: integer
                                    description: |
                                      The number of tokens that overlap between chunks. The default value is `400`.

                                      Note that the overlap must not exceed half of `max_chunk_size_tokens`.
                                required:
                                  - max_chunk_size_tokens
                                  - chunk_overlap_tokens
                            required:
                              - type
                              - static
                      metadata:
                        type: object
                        description: |
                          Set of 16 key-value pairs that can be attached to a vector store. This can be useful for storing additional information about the vector store in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.
              oneOf:
                - required: [vector_store_ids]
                - required: [vector_stores]
          nullable: true
        metadata:
          description: *metadata_description
          type: object
          nullable: true

    modifyThreadRequest:
      type: object
      additionalProperties: false
      properties:
        tool_resources:
          type: object
          description: |
            A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
          properties:
            code_interpreter:
              type: object
              properties:
                file_ids:
                  type: array
                  description: |
                    A list of File IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.
                  default: []
                  maxItems: 20
                  items:
                    type: string
            file_search:
              type: object
              properties:
                vector_store_ids:
                  type: array
                  description: |
                    The vector store attached to this thread. There can be a maximum of 1 vector store attached to the thread.
                  maxItems: 1
                  items:
                    type: string
          nullable: true
        metadata:
          description: *metadata_description
          type: object
          nullable: true

    deleteThreadResponse:
      type: object
      properties:
        id:
          type: string
        deleted:
          type: boolean
        object:
          type: string
          enum:
            - thread.deleted
          x-ms-enum:
            name: DeleteThreadResponseObjectState
            modelAsString: true
            values:
              - value: thread.deleted
                description: The delete thread response object state which is `thread.deleted`
      required:
        - id
        - object
        - deleted

    listThreadsResponse:
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: "#/components/schemas/threadObject"
        first_id:
          type: string
          example: asst_hLBK7PXBv5Lr2NQT7KLY0ag1
        last_id:
          type: string
          example: asst_QLoItBbqwyAJEzlTy4y9kOMM
        has_more:
          type: boolean
          example: false
      required:
        - object
        - data
        - first_id
        - last_id
        - has_more

    messageObject:
      type: object
      title: The message object
      description: Represents a message within a [thread](/docs/api-reference/threads).
      properties:
        id:
          description: The identifier, which can be referenced in API endpoints.
          type: string
        object:
          description: The object type, which is always `thread.message`.
          type: string
          enum:
            - thread.message
          x-ms-enum:
            name: MessageObjectType
            modelAsString: true
            values:
              - value: thread.message
                description: The message object type which is `thread.message`
        created_at:
          description: The Unix timestamp (in seconds) for when the message was created.
          type: integer
        thread_id:
          description: The [thread](/docs/api-reference/threads) ID that this message belongs to.
          type: string
        status:
          description: The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.
          type: string
          enum: ["in_progress", "incomplete", "completed"]
          x-ms-enum:
            name: MessageObjectStatus
            modelAsString: true
            values:
              - value: in_progress
              - value: incomplete
              - value: completed
        incomplete_details:
          description: On an incomplete message, details about why the message is incomplete.
          type: object
          properties:
            reason:
              type: string
              description: The reason the message is incomplete.
              enum:
                [
                  "content_filter",
                  "max_tokens",
                  "run_cancelled",
                  "run_expired",
                  "run_failed",
                ]
              x-ms-enum:
                name: MessageObjectIncompleteReason
                modelAsString: true
                values:
                  - value: content_filter
                  - value: max_tokens
                  - value: run_cancelled
                  - value: run_expired
                  - value: run_failed
          nullable: true
          required:
            - reason
        completed_at:
          description: The Unix timestamp (in seconds) for when the message was completed.
          type: integer
          nullable: true
        incomplete_at:
          description: The Unix timestamp (in seconds) for when the message was marked as incomplete.
          type: integer
          nullable: true
        role:
          description: The entity that produced the message. One of `user` or `assistant`.
          type: string
          enum:
            - user
            - assistant
          x-ms-enum:
            name: MessageObjectRole
            modelAsString: true
            values:
              - value: user
              - value: assistant
        content:
          description: The content of the message in array of text and/or images.
          type: array
          items:
            oneOf:
              - $ref: "#/components/schemas/messageContentImageFileObject"
              - $ref: "#/components/schemas/messageContentTextObject"
        assistant_id:
          description: If applicable, the ID of the assistant that authored this message.
          type: string
          nullable: true
        run_id:
          description: If applicable, the ID of the [run](/docs/api-reference/runs) associated with the authoring of this message.
          type: string
          nullable: true
        attachments:
          type: array
          items:
            type: object
            properties:
              file_id:
                type: string
                description: The ID of the file to attach to the message.
              tools:
                description: The tools to add this file to.
                type: array
                items:
                  oneOf:
                    - $ref: "#/components/schemas/assistantToolsCode"
                    - $ref: "#/components/schemas/assistantToolsFileSearchTypeOnly"
          description: A list of files attached to the message, and the tools they were added to.
          nullable: true
        metadata:
          description: *metadata_description
          type: object
          nullable: true
      required:
        - id
        - object
        - created_at
        - thread_id
        - status
        - incomplete_details
        - completed_at
        - incomplete_at
        - role
        - content
        - assistant_id
        - run_id
        - attachments
        - metadata

    messageDeltaObject:
      type: object
      title: Message delta object
      description: |
        Represents a message delta i.e. any changed fields on a message during streaming.
      properties:
        id:
          description: The identifier of the message, which can be referenced in API endpoints.
          type: string
        object:
          description: The object type, which is always `thread.message.delta`.
          type: string
          enum: ["thread.message.delta"]
          x-ms-enum:
            name: MessageDeltaObjectType
            modelAsString: true
            values:
              - value: thread.message.delta
        delta:
          description: The delta containing the fields that have changed on the Message.
          type: object
          properties:
            role:
              description: The entity that produced the message. One of `user` or `assistant`.
              type: string
              enum: ["user", "assistant"]
              x-ms-enum:
                name: MessageDeltaObjectDeltaRole
                modelAsString: true
                values:
                  - value: user
                  - value: assistant
            content:
              description: The content of the message in array of text and/or images.
              type: array
              items:
                oneOf:
                  - $ref: "#/components/schemas/messageDeltaContentImageFileObject"
                  - $ref: "#/components/schemas/messageDeltaContentTextObject"
      required:
        - id
        - object
        - delta

    createMessageRequest:
      type: object
      additionalProperties: false
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
          x-ms-enum:
            name: CreateMessageRequestRole
            modelAsString: true
            values:
              - value: user
              - value: assistant
          description: |
            The role of the entity that is creating the message. Allowed values include:
            - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.
            - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
        content:
          type: string
          minLength: 1
          maxLength: 256000
          description: The content of the message.
        attachments:
          type: array
          items:
            type: object
            properties:
              file_id:
                type: string
                description: The ID of the file to attach to the message.
              tools:
                description: The tools to add this file to.
                type: array
                items:
                  oneOf:
                    - $ref: "#/components/schemas/assistantToolsCode"
                    - $ref: "#/components/schemas/assistantToolsFileSearchTypeOnly"
                  x-oaiExpandable: true
          description: A list of files attached to the message, and the tools they should be added to.
          required:
            - file_id
            - tools
          nullable: true
        metadata:
          description: *metadata_description
          type: object
          nullable: true
    modifyMessageRequest:
      type: object
      additionalProperties: false
      properties:
        metadata:
          description: *metadata_description
          type: object
          nullable: true
    deleteMessageResponse:
      type: object
      properties:
        id:
          type: string
        deleted:
          type: boolean
        object:
          type: string
          enum:
            - thread.message.deleted
          x-ms-enum:
            name: DeleteMessageResponseObject
            modelAsString: true
            values:
              - value: thread.message.deleted
                description: The delete message response object state
      required:
        - id
        - object
        - deleted
    listMessagesResponse:
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: "#/components/schemas/messageObject"
        first_id:
          type: string
          example: msg_hLBK7PXBv5Lr2NQT7KLY0ag1
        last_id:
          type: string
          example: msg_QLoItBbqwyAJEzlTy4y9kOMM
        has_more:
          type: boolean
          example: false
      required:
        - object
        - data
        - first_id
        - last_id
        - has_more

    messageContentImageFileObject:
      title: Image file
      type: object
      description: References an image file in the content of a message.
      properties:
        type:
          description: Always `image_file`.
          type: string
          enum:
            - image_file
          x-ms-enum:
            name: MessageContentImageFileObjectType
            modelAsString: true
            values:
              - value: image_file
                description: The message content image file type
        image_file:
          type: object
          properties:
            file_id:
              description: The file ID of the image in the message content.
              type: string
          required:
            - file_id
      required:
        - type
        - image_file

    messageContentTextObject:
      title: Text
      type: object
      description: The text content that is part of a message.
      properties:
        type:
          description: Always `text`.
          type: string
          enum:
            - text
          x-ms-enum:
            name: messageContentTextObjectType
            modelAsString: true
            values:
              - value: text
                description: The message content text Object type
        text:
          type: object
          properties:
            value:
              description: The data that makes up the text.
              type: string
            annotations:
              type: array
              items:
                oneOf:
                  - $ref: "#/components/schemas/messageContentTextAnnotationsFileCitationObject"
                  - $ref: "#/components/schemas/messageContentTextAnnotationsFilePathObject"
          required:
            - value
            - annotations
      required:
        - type
        - text

    messageContentTextAnnotationsFileCitationObject:
      title: File citation
      type: object
      description: A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "retrieval" tool to search files.
      properties:
        type:
          description: Always `file_citation`.
          type: string
          enum:
            - file_citation
          x-ms-enum:
            name: FileCitationObjectType
            modelAsString: true
            values:
              - value: file_citation
                description: The file citation object type
        text:
          description: The text in the message content that needs to be replaced.
          type: string
        file_citation:
          type: object
          properties:
            file_id:
              description: The ID of the specific File the citation is from.
              type: string
          required:
            - file_id
        start_index:
          type: integer
          minimum: 0
        end_index:
          type: integer
          minimum: 0
      required:
        - type
        - text
        - file_citation
        - start_index
        - end_index

    messageContentTextAnnotationsFilePathObject:
      title: File path
      type: object
      description: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.
      properties:
        type:
          description: Always `file_path`.
          type: string
          enum:
            - file_path
          x-ms-enum:
            name: FilePathObjectType
            modelAsString: true
            values:
              - value: file_path
                description: The file path object type
        text:
          description: The text in the message content that needs to be replaced.
          type: string
        file_path:
          type: object
          properties:
            file_id:
              description: The ID of the file that was generated.
              type: string
          required:
            - file_id
        start_index:
          type: integer
          minimum: 0
        end_index:
          type: integer
          minimum: 0
      required:
        - type
        - text
        - file_path
        - start_index
        - end_index

    messageDeltaContentImageFileObject:
      title: Image file
      type: object
      description: References an image File in the content of a message.
      properties:
        index:
          type: integer
          description: The index of the content part in the message.
        type:
          description: Always `image_file`.
          type: string
          enum: ["image_file"]
          x-ms-enum:
            name: MessageDeltaContentImageFileObjectType
            modelAsString: true
            values:
              - value: image_file
        image_file:
          type: object
          properties:
            file_id:
              description: The File ID of the image in the message content.
              type: string
      required:
        - index
        - type

    messageDeltaContentTextObject:
      title: Text
      type: object
      description: The text content that is part of a message.
      properties:
        index:
          type: integer
          description: The index of the content part in the message.
        type:
          description: Always `text`.
          type: string
          enum: ["text"]
          x-ms-enum:
            name: MessageDeltaContentTextObjectType
            modelAsString: true
            values:
              - value: text
        text:
          type: object
          properties:
            value:
              description: The data that makes up the text.
              type: string
            annotations:
              type: array
              items:
                oneOf:
                  - $ref: "#/components/schemas/messageDeltaContentTextAnnotationsFileCitationObject"
                  - $ref: "#/components/schemas/messageDeltaContentTextAnnotationsFilePathObject"
      required:
        - index
        - type

    messageDeltaContentTextAnnotationsFileCitationObject:
      title: File citation
      type: object
      description: A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
      properties:
        index:
          type: integer
          description: The index of the annotation in the text content part.
        type:
          description: Always `file_citation`.
          type: string
          enum: ["file_citation"]
          x-ms-enum:
            name: MessageDeltaContentTextAnnotationsFileCitationObjectType
            modelAsString: true
            values:
              - value: file_citation
        text:
          description: The text in the message content that needs to be replaced.
          type: string
        file_citation:
          type: object
          properties:
            file_id:
              description: The ID of the specific File the citation is from.
              type: string
            quote:
              description: The specific quote in the file.
              type: string
        start_index:
          type: integer
          minimum: 0
        end_index:
          type: integer
          minimum: 0
      required:
        - index
        - type

    messageDeltaContentTextAnnotationsFilePathObject:
      title: File path
      type: object
      description: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



