specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-05-01-preview/inference.yaml [3700:4474]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    chatCompletionFunctionCall:
      type: object
      description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
      properties:
        name:
          type: string
          description: The name of the function to call.
        arguments:
          type: string
          description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
      required:
        - name
        - arguments
    chatCompletionsResponseCommon:
      type: object
      properties:
        id:
          type: string
          description: A unique identifier for the chat completion.
        object:
          $ref: '#/components/schemas/chatCompletionResponseObject'
        created:
          type: integer
          format: unixtime
          description: The Unix timestamp (in seconds) of when the chat completion was created.
        model:
          type: string
          description: The model used for the chat completion.
        usage:
          $ref: '#/components/schemas/completionUsage'
        system_fingerprint:
          type: string
          description: Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
      required:
        - id
        - object
        - created
        - model
    chatCompletionResponseObject:
      type: string
      description: The object type.
      enum:
        - chat.completion
      x-ms-enum:
        name: ChatCompletionResponseObject
        modelAsString: true
        values:
          - value: chat.completion
            description: The object type is chat completion.
    completionUsage:
      type: object
      description: Usage statistics for the completion request.
      properties:
        prompt_tokens:
          type: integer
          description: Number of tokens in the prompt.
        completion_tokens:
          type: integer
          description: Number of tokens in the generated completion.
        total_tokens:
          type: integer
          description: Total number of tokens used in the request (prompt + completion).
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
    chatCompletionTool:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/chatCompletionToolType'
        function:
          type: object
          properties:
            description:
              type: string
              description: A description of what the function does, used by the model to choose when and how to call the function.
            name:
              type: string
              description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
            parameters:
              $ref: '#/components/schemas/chatCompletionFunctionParameters'
          required:
            - name
            - parameters
      required:
        - type
        - function
    
    FunctionParameters:
      type: object
      description: "The parameters the functions accepts, described as a JSON Schema object. See the guide](/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list."
      additionalProperties: true
    
    functionObject:
      type: object
      properties:
        description:
          type: string
          description: A description of what the function does, used by the model to choose when and how to call the function.
        name:
          type: string
          description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
        parameters:
          $ref: "#/components/schemas/FunctionParameters"
      required:
        - name
    
    chatCompletionToolType:
      type: string
      enum:
        - function
      description: The type of the tool. Currently, only `function` is supported.
      x-ms-enum:
        name: ChatCompletionToolType
        modelAsString: true
        values:
          - value: function
            description: The tool type is function.
    chatCompletionChoiceCommon:
      type: object
      properties:
        index:
          type: integer
        finish_reason:
          type: string
    createTranslationRequest:
      type: object
      description: Translation request.
      properties:
        file:
          type: string
          description: The audio file to translate.
          format: binary
        prompt:
          type: string
          description: An optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.
        response_format:
          $ref: '#/components/schemas/audioResponseFormat'
        temperature:
          type: number
          default: 0
          description: The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
      required:
        - file
    audioResponse:
      description: Translation or transcription response when response_format was json
      type: object
      properties:
        text:
          type: string
          description: Translated or transcribed text.
      required:
        - text
    audioVerboseResponse:
      description: Translation or transcription response when response_format was verbose_json
      type: object
      allOf:
        - $ref: '#/components/schemas/audioResponse'
        - properties:
            task:
              type: string
              description: Type of audio task.
              enum:
                - transcribe
                - translate
              x-ms-enum:
                modelAsString: true
            language:
              type: string
              description: Language.
            duration:
              type: number
              description: Duration.
            segments:
              type: array
              items:
                $ref: '#/components/schemas/audioSegment'
            words:
              type: array
              items:
                $ref: '#/components/schemas/audioWord'

      required:
        - text
    audioResponseFormat:
      title: AudioResponseFormat
      description: Defines the format of the output.
      enum:
        - json
        - text
        - srt
        - verbose_json
        - vtt
      type: string
      x-ms-enum:
        modelAsString: true
    createTranscriptionRequest:
      type: object
      description: Transcription request.
      properties:
        file:
          type: string
          description: The audio file object to transcribe.
          format: binary
        prompt:
          type: string
          description: An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
        response_format:
          $ref: '#/components/schemas/audioResponseFormat'
        temperature:
          type: number
          default: 0
          description: The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
        language:
          type: string
          description: The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.
        timestamp_granularities[]:
          description: |
            The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
          type: array
          items:
            type: string
            enum:
              - word
              - segment
          default: [segment]
      required:
        - file
    audioSegment:
      type: object
      description: Transcription or translation segment.
      properties:
        id:
          type: integer
          description: Segment identifier.
        seek:
          type: number
          description: Offset of the segment.
        start:
          type: number
          description: Segment start offset.
        end:
          type: number
          description: Segment end offset.
        text:
          type: string
          description: Segment text.
        tokens:
          type: array
          items:
            type: number
            nullable: false
          description: Tokens of the text.
        temperature:
          type: number
          description: Temperature.
        avg_logprob:
          type: number
          description: Average log probability.
        compression_ratio:
          type: number
          description: Compression ratio.
        no_speech_prob:
          type: number
          description: Probability of 'no speech'.
    audioWord:
      type: object
      description: Transcription or translation word.
      properties:
          word:
            type: string
            description: Word
          start:
            type: number
            description: Word start offset.
          end:
            type: number
            description: Word end offset.
    createSpeechRequest:
      type: object
      description: Speech request.
      properties:
        input:
          type: string
          description: The text to synthesize audio for. The maximum length is 4096 characters.
          maxLength: 4096
        voice:
          type: string
          description: The voice to use for speech synthesis.
          enum:
            - alloy
            - echo
            - fable
            - onyx
            - nova
            - shimmer
        response_format:
          type: string
          description: The format to synthesize the audio in.
          enum:
            - mp3
            - opus
            - aac
            - flac
            - wav
            - pcm
        speed:
          description: The speed of the synthesize audio. Select a value from `0.25` to `4.0`. `1.0` is the default.
          type: number
          default: 1
          minimum: 0.25
          maximum: 4
      required:
        - input
        - voice
    imageQuality:
      description: The quality of the image that will be generated.
      type: string
      enum:
        - standard
        - hd
      default: standard
      x-ms-enum:
        name: Quality
        modelAsString: true
        values:
          - value: standard
            description: Standard quality creates images with standard quality.
            name: Standard
          - value: hd
            description: HD quality creates images with finer details and greater consistency across the image.
            name: HD
    imagesResponseFormat:
      description: The format in which the generated images are returned.
      type: string
      enum:
        - url
        - b64_json
      default: url
      x-ms-enum:
        name: ImagesResponseFormat
        modelAsString: true
        values:
          - value: url
            description: The URL that provides temporary access to download the generated images.
            name: Url
          - value: b64_json
            description: The generated images are returned as base64 encoded string.
            name: Base64Json
    imageSize:
      description: The size of the generated images.
      type: string
      enum:
        - 256x256
        - 512x512
        - 1792x1024
        - 1024x1792
        - 1024x1024
      default: 1024x1024
      x-ms-enum:
        name: Size
        modelAsString: true
        values:
          - value: 256x256
            description: The desired size of the generated image is 256x256 pixels. Only supported for dall-e-2.
            name: Size256x256
          - value: 512x512
            description: The desired size of the generated image is 512x512 pixels. Only supported for dall-e-2.
            name: Size512x512
          - value: 1792x1024
            description: The desired size of the generated image is 1792x1024 pixels. Only supported for dall-e-3.
            name: Size1792x1024
          - value: 1024x1792
            description: The desired size of the generated image is 1024x1792 pixels. Only supported for dall-e-3.
            name: Size1024x1792
          - value: 1024x1024
            description: The desired size of the generated image is 1024x1024 pixels.
            name: Size1024x1024
    imageStyle:
      description: The style of the generated images.
      type: string
      enum:
        - vivid
        - natural
      default: vivid
      x-ms-enum:
        name: Style
        modelAsString: true
        values:
          - value: vivid
            description: Vivid creates images that are hyper-realistic and dramatic.
            name: Vivid
          - value: natural
            description: Natural creates images that are more natural and less hyper-realistic.
            name: Natural
    imageGenerationsRequest:
      type: object
      properties:
        prompt:
          description: A text description of the desired image(s). The maximum length is 4000 characters.
          type: string
          format: string
          example: a corgi in a field
          minLength: 1
        'n':
          description: The number of images to generate.
          type: integer
          minimum: 1
          maximum: 1
          default: 1
        size:
          $ref: '#/components/schemas/imageSize'
        response_format:
          $ref: '#/components/schemas/imagesResponseFormat'
        user:
          description: A unique identifier representing your end-user, which can help to monitor and detect abuse.
          type: string
          format: string
          example: user123456
        quality:
          $ref: '#/components/schemas/imageQuality'
        style:
          $ref: '#/components/schemas/imageStyle'
      required:
        - prompt
    generateImagesResponse:
      type: object
      properties:
        created:
          type: integer
          format: unixtime
          description: The unix timestamp when the operation was created.
          example: '1676540381'
        data:
          type: array
          description: The result data of the operation, if successful
          items:
            $ref: '#/components/schemas/imageResult'
      required:
        - created
        - data
    imageResult:
      type: object
      description: The image url or encoded image if successful, and an error otherwise.
      properties:
        url:
          type: string
          description: The image url.
          example: https://www.contoso.com
        b64_json:
          type: string
          description: The base64 encoded image
        content_filter_results:
          $ref: '#/components/schemas/dalleContentFilterResults'
        revised_prompt:
          type: string
          description: The prompt that was used to generate the image, if there was any revision to the prompt.
        prompt_filter_results:
          $ref: '#/components/schemas/dalleFilterResults'
    line:
      type: object
      description: A content line object consisting of an adjacent sequence of content elements, such as words and selection marks.
      properties:
        text:
          type: string
        spans:
          type: array
          description: An array of spans that represent detected objects and its bounding box information.
          items:
            $ref: '#/components/schemas/span'
      required:
        - text
        - spans
    span:
      type: object
      description: A span object that represents a detected object and its bounding box information.
      properties:
        text:
          type: string
          description: The text content of the span that represents the detected object.
        offset:
          type: integer
          description: The character offset within the text where the span begins. This offset is defined as the position of the first character of the span, counting from the start of the text as Unicode codepoints.
        length:
          type: integer
          description: The length of the span in characters, measured in Unicode codepoints.
        polygon:
          type: array
          description: An array of objects representing points in the polygon that encloses the detected object.
          items:
            type: object
            properties:
              x:
                type: number
                description: The x-coordinate of the point.
              'y':
                type: number
                description: The y-coordinate of the point.
      required:
        - text
        - offset
        - length
        - polygon
    
    runCompletionUsage:
      type: object
      description: Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).
      properties:
        completion_tokens:
          type: integer
          description: Number of completion tokens used over the course of the run.
        prompt_tokens:
          type: integer
          description: Number of prompt tokens used over the course of the run.
        total_tokens:
          type: integer
          description: Total number of tokens used (prompt + completion).
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      nullable: true

    runStepCompletionUsage:
      type: object
      description: Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.
      properties:
        completion_tokens:
          type: integer
          description: Number of completion tokens used over the course of the run step.
        prompt_tokens:
          type: integer
          description: Number of prompt tokens used over the course of the run step.
        total_tokens:
          type: integer
          description: Total number of tokens used (prompt + completion).
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      nullable: true

    assistantsApiResponseFormatOption:
      description: |
        Specifies the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.

        Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON.

        **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.
      oneOf:
        - type: string
          description: >
            `auto` is the default value
          enum: [none, auto]
          x-ms-enum:
            name: AssistantsApiResponseFormatOption
            modelAsString: true
            values:
              - value: none
              - value: auto
        - $ref: "#/components/schemas/assistantsApiResponseFormat"

    assistantsApiResponseFormat:
      type: object
      description: |
        An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run. If `text` the model can return text or any value needed.
      properties:
        type:
          type: string
          enum: ["text", "json_object"]
          x-ms-enum:
            name: AssistantsApiResponseFormat
            modelAsString: true
            values:
              - value: text
              - value: json_object
          example: "json_object"
          default: "text"
          description: Must be one of `text` or `json_object`.

    assistantObject:
      type: object
      title: Assistant
      description: Represents an `assistant` that can call the model and use tools.
      properties:
        id:
          description: The identifier, which can be referenced in API endpoints.
          type: string
        object:
          description: The object type, which is always `assistant`.
          type: string
          enum:
            - assistant
          x-ms-enum:
            name: AssistantObjectType
            modelAsString: true
            values:
              - value: assistant
        created_at:
          type: integer
          description: The Unix timestamp (in seconds) for when the assistant was created.
        name:
          description: &assistant_name_param_description |
            The name of the assistant. The maximum length is 256 characters.
          type: string
          maxLength: 256
          nullable: true
        description:
          description: &assistant_description_param_description |
            The description of the assistant. The maximum length is 512 characters.
          type: string
          maxLength: 512
          nullable: true
        model:
          description: |
            ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
          type: string
        instructions:
          description:  &assistant_instructions_param_description |
            The system instructions that the assistant uses. The maximum length is 256,000 characters.
          type: string
          maxLength: 256000
          nullable: true
        tools:
          description: &assistant_tools_param_description |
            A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
          default: []
          type: array
          maxItems: 128
          items:
            oneOf:
              - $ref: '#/components/schemas/assistantToolsCode'
              - $ref: '#/components/schemas/assistantToolsFileSearch'
              - $ref: '#/components/schemas/assistantToolsFunction'
        tool_resources:
          type: object
          description: |
            A set of resources that are used by the assistant's tools. 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 ID of the vector store attached to this assistant. There can be a maximum of 1 vector store attached to the assistant.
                  maxItems: 1
                  items:
                    type: string
        metadata:
          description: &metadata_description |
            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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.
          type: object
          nullable: true
        temperature:
          description: &run_temperature_description |
            What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
          type: number
          minimum: 0
          maximum: 2
          default: 1
          example: 1
          nullable: true
        top_p:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          example: 1
          nullable: true
          description: &run_top_p_description |
            An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

            We generally recommend altering this or temperature but not both.
        response_format:
          $ref: "#/components/schemas/assistantsApiResponseFormatOption"
          nullable: true
      required:
        - id
        - object
        - created_at
        - name
        - description
        - model
        - instructions
        - tools
        - metadata
        
    createAssistantRequest:
      type: object
      additionalProperties: false
      properties:
        model:
          description: |
            ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
          anyOf:
            - type: string
        name:
          description: *assistant_name_param_description
          type: string
          nullable: true
          maxLength: 256
        description:
          description: *assistant_description_param_description
          type: string
          nullable: true
          maxLength: 512
        instructions:
          description: *assistant_instructions_param_description
          type: string
          nullable: true
          maxLength: 256000
        tools:
          description: *assistant_tools_param_description
          default: []
          type: array
          maxItems: 128
          items:
            oneOf:
              - $ref: '#/components/schemas/assistantToolsCode'
              - $ref: '#/components/schemas/assistantToolsFileSearch'
              - $ref: '#/components/schemas/assistantToolsFunction'
        tool_resources:
          type: object
          description: |
            A set of resources that are used by the assistant's tools. 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 assistant. There can be a maximum of 1 vector store attached to the assistant.
                  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 assistant. There can be a maximum of 1 vector store attached to the assistant.
                  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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-07-01-preview/inference.yaml [3714:4488]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    chatCompletionFunctionCall:
      type: object
      description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
      properties:
        name:
          type: string
          description: The name of the function to call.
        arguments:
          type: string
          description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
      required:
        - name
        - arguments
    chatCompletionsResponseCommon:
      type: object
      properties:
        id:
          type: string
          description: A unique identifier for the chat completion.
        object:
          $ref: '#/components/schemas/chatCompletionResponseObject'
        created:
          type: integer
          format: unixtime
          description: The Unix timestamp (in seconds) of when the chat completion was created.
        model:
          type: string
          description: The model used for the chat completion.
        usage:
          $ref: '#/components/schemas/completionUsage'
        system_fingerprint:
          type: string
          description: Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
      required:
        - id
        - object
        - created
        - model
    chatCompletionResponseObject:
      type: string
      description: The object type.
      enum:
        - chat.completion
      x-ms-enum:
        name: ChatCompletionResponseObject
        modelAsString: true
        values:
          - value: chat.completion
            description: The object type is chat completion.
    completionUsage:
      type: object
      description: Usage statistics for the completion request.
      properties:
        prompt_tokens:
          type: integer
          description: Number of tokens in the prompt.
        completion_tokens:
          type: integer
          description: Number of tokens in the generated completion.
        total_tokens:
          type: integer
          description: Total number of tokens used in the request (prompt + completion).
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
    chatCompletionTool:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/chatCompletionToolType'
        function:
          type: object
          properties:
            description:
              type: string
              description: A description of what the function does, used by the model to choose when and how to call the function.
            name:
              type: string
              description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
            parameters:
              $ref: '#/components/schemas/chatCompletionFunctionParameters'
          required:
            - name
            - parameters
      required:
        - type
        - function
    
    FunctionParameters:
      type: object
      description: "The parameters the functions accepts, described as a JSON Schema object. See the guide](/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list."
      additionalProperties: true
    
    functionObject:
      type: object
      properties:
        description:
          type: string
          description: A description of what the function does, used by the model to choose when and how to call the function.
        name:
          type: string
          description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
        parameters:
          $ref: "#/components/schemas/FunctionParameters"
      required:
        - name
    
    chatCompletionToolType:
      type: string
      enum:
        - function
      description: The type of the tool. Currently, only `function` is supported.
      x-ms-enum:
        name: ChatCompletionToolType
        modelAsString: true
        values:
          - value: function
            description: The tool type is function.
    chatCompletionChoiceCommon:
      type: object
      properties:
        index:
          type: integer
        finish_reason:
          type: string
    createTranslationRequest:
      type: object
      description: Translation request.
      properties:
        file:
          type: string
          description: The audio file to translate.
          format: binary
        prompt:
          type: string
          description: An optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.
        response_format:
          $ref: '#/components/schemas/audioResponseFormat'
        temperature:
          type: number
          default: 0
          description: The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
      required:
        - file
    audioResponse:
      description: Translation or transcription response when response_format was json
      type: object
      properties:
        text:
          type: string
          description: Translated or transcribed text.
      required:
        - text
    audioVerboseResponse:
      description: Translation or transcription response when response_format was verbose_json
      type: object
      allOf:
        - $ref: '#/components/schemas/audioResponse'
        - properties:
            task:
              type: string
              description: Type of audio task.
              enum:
                - transcribe
                - translate
              x-ms-enum:
                modelAsString: true
            language:
              type: string
              description: Language.
            duration:
              type: number
              description: Duration.
            segments:
              type: array
              items:
                $ref: '#/components/schemas/audioSegment'
            words:
              type: array
              items:
                $ref: '#/components/schemas/audioWord'

      required:
        - text
    audioResponseFormat:
      title: AudioResponseFormat
      description: Defines the format of the output.
      enum:
        - json
        - text
        - srt
        - verbose_json
        - vtt
      type: string
      x-ms-enum:
        modelAsString: true
    createTranscriptionRequest:
      type: object
      description: Transcription request.
      properties:
        file:
          type: string
          description: The audio file object to transcribe.
          format: binary
        prompt:
          type: string
          description: An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
        response_format:
          $ref: '#/components/schemas/audioResponseFormat'
        temperature:
          type: number
          default: 0
          description: The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
        language:
          type: string
          description: The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.
        timestamp_granularities[]:
          description: |
            The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
          type: array
          items:
            type: string
            enum:
              - word
              - segment
          default: [segment]
      required:
        - file
    audioSegment:
      type: object
      description: Transcription or translation segment.
      properties:
        id:
          type: integer
          description: Segment identifier.
        seek:
          type: number
          description: Offset of the segment.
        start:
          type: number
          description: Segment start offset.
        end:
          type: number
          description: Segment end offset.
        text:
          type: string
          description: Segment text.
        tokens:
          type: array
          items:
            type: number
            nullable: false
          description: Tokens of the text.
        temperature:
          type: number
          description: Temperature.
        avg_logprob:
          type: number
          description: Average log probability.
        compression_ratio:
          type: number
          description: Compression ratio.
        no_speech_prob:
          type: number
          description: Probability of 'no speech'.
    audioWord:
      type: object
      description: Transcription or translation word.
      properties:
          word:
            type: string
            description: Word
          start:
            type: number
            description: Word start offset.
          end:
            type: number
            description: Word end offset.
    createSpeechRequest:
      type: object
      description: Speech request.
      properties:
        input:
          type: string
          description: The text to synthesize audio for. The maximum length is 4096 characters.
          maxLength: 4096
        voice:
          type: string
          description: The voice to use for speech synthesis.
          enum:
            - alloy
            - echo
            - fable
            - onyx
            - nova
            - shimmer
        response_format:
          type: string
          description: The format to synthesize the audio in.
          enum:
            - mp3
            - opus
            - aac
            - flac
            - wav
            - pcm
        speed:
          description: The speed of the synthesize audio. Select a value from `0.25` to `4.0`. `1.0` is the default.
          type: number
          default: 1
          minimum: 0.25
          maximum: 4
      required:
        - input
        - voice
    imageQuality:
      description: The quality of the image that will be generated.
      type: string
      enum:
        - standard
        - hd
      default: standard
      x-ms-enum:
        name: Quality
        modelAsString: true
        values:
          - value: standard
            description: Standard quality creates images with standard quality.
            name: Standard
          - value: hd
            description: HD quality creates images with finer details and greater consistency across the image.
            name: HD
    imagesResponseFormat:
      description: The format in which the generated images are returned.
      type: string
      enum:
        - url
        - b64_json
      default: url
      x-ms-enum:
        name: ImagesResponseFormat
        modelAsString: true
        values:
          - value: url
            description: The URL that provides temporary access to download the generated images.
            name: Url
          - value: b64_json
            description: The generated images are returned as base64 encoded string.
            name: Base64Json
    imageSize:
      description: The size of the generated images.
      type: string
      enum:
        - 256x256
        - 512x512
        - 1792x1024
        - 1024x1792
        - 1024x1024
      default: 1024x1024
      x-ms-enum:
        name: Size
        modelAsString: true
        values:
          - value: 256x256
            description: The desired size of the generated image is 256x256 pixels. Only supported for dall-e-2.
            name: Size256x256
          - value: 512x512
            description: The desired size of the generated image is 512x512 pixels. Only supported for dall-e-2.
            name: Size512x512
          - value: 1792x1024
            description: The desired size of the generated image is 1792x1024 pixels. Only supported for dall-e-3.
            name: Size1792x1024
          - value: 1024x1792
            description: The desired size of the generated image is 1024x1792 pixels. Only supported for dall-e-3.
            name: Size1024x1792
          - value: 1024x1024
            description: The desired size of the generated image is 1024x1024 pixels.
            name: Size1024x1024
    imageStyle:
      description: The style of the generated images.
      type: string
      enum:
        - vivid
        - natural
      default: vivid
      x-ms-enum:
        name: Style
        modelAsString: true
        values:
          - value: vivid
            description: Vivid creates images that are hyper-realistic and dramatic.
            name: Vivid
          - value: natural
            description: Natural creates images that are more natural and less hyper-realistic.
            name: Natural
    imageGenerationsRequest:
      type: object
      properties:
        prompt:
          description: A text description of the desired image(s). The maximum length is 4000 characters.
          type: string
          format: string
          example: a corgi in a field
          minLength: 1
        'n':
          description: The number of images to generate.
          type: integer
          minimum: 1
          maximum: 1
          default: 1
        size:
          $ref: '#/components/schemas/imageSize'
        response_format:
          $ref: '#/components/schemas/imagesResponseFormat'
        user:
          description: A unique identifier representing your end-user, which can help to monitor and detect abuse.
          type: string
          format: string
          example: user123456
        quality:
          $ref: '#/components/schemas/imageQuality'
        style:
          $ref: '#/components/schemas/imageStyle'
      required:
        - prompt
    generateImagesResponse:
      type: object
      properties:
        created:
          type: integer
          format: unixtime
          description: The unix timestamp when the operation was created.
          example: '1676540381'
        data:
          type: array
          description: The result data of the operation, if successful
          items:
            $ref: '#/components/schemas/imageResult'
      required:
        - created
        - data
    imageResult:
      type: object
      description: The image url or encoded image if successful, and an error otherwise.
      properties:
        url:
          type: string
          description: The image url.
          example: https://www.contoso.com
        b64_json:
          type: string
          description: The base64 encoded image
        content_filter_results:
          $ref: '#/components/schemas/dalleContentFilterResults'
        revised_prompt:
          type: string
          description: The prompt that was used to generate the image, if there was any revision to the prompt.
        prompt_filter_results:
          $ref: '#/components/schemas/dalleFilterResults'
    line:
      type: object
      description: A content line object consisting of an adjacent sequence of content elements, such as words and selection marks.
      properties:
        text:
          type: string
        spans:
          type: array
          description: An array of spans that represent detected objects and its bounding box information.
          items:
            $ref: '#/components/schemas/span'
      required:
        - text
        - spans
    span:
      type: object
      description: A span object that represents a detected object and its bounding box information.
      properties:
        text:
          type: string
          description: The text content of the span that represents the detected object.
        offset:
          type: integer
          description: The character offset within the text where the span begins. This offset is defined as the position of the first character of the span, counting from the start of the text as Unicode codepoints.
        length:
          type: integer
          description: The length of the span in characters, measured in Unicode codepoints.
        polygon:
          type: array
          description: An array of objects representing points in the polygon that encloses the detected object.
          items:
            type: object
            properties:
              x:
                type: number
                description: The x-coordinate of the point.
              'y':
                type: number
                description: The y-coordinate of the point.
      required:
        - text
        - offset
        - length
        - polygon
    
    runCompletionUsage:
      type: object
      description: Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).
      properties:
        completion_tokens:
          type: integer
          description: Number of completion tokens used over the course of the run.
        prompt_tokens:
          type: integer
          description: Number of prompt tokens used over the course of the run.
        total_tokens:
          type: integer
          description: Total number of tokens used (prompt + completion).
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      nullable: true

    runStepCompletionUsage:
      type: object
      description: Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.
      properties:
        completion_tokens:
          type: integer
          description: Number of completion tokens used over the course of the run step.
        prompt_tokens:
          type: integer
          description: Number of prompt tokens used over the course of the run step.
        total_tokens:
          type: integer
          description: Total number of tokens used (prompt + completion).
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      nullable: true

    assistantsApiResponseFormatOption:
      description: |
        Specifies the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.

        Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON.

        **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.
      oneOf:
        - type: string
          description: >
            `auto` is the default value
          enum: [none, auto]
          x-ms-enum:
            name: AssistantsApiResponseFormatOption
            modelAsString: true
            values:
              - value: none
              - value: auto
        - $ref: "#/components/schemas/assistantsApiResponseFormat"

    assistantsApiResponseFormat:
      type: object
      description: |
        An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run. If `text` the model can return text or any value needed.
      properties:
        type:
          type: string
          enum: ["text", "json_object"]
          x-ms-enum:
            name: AssistantsApiResponseFormat
            modelAsString: true
            values:
              - value: text
              - value: json_object
          example: "json_object"
          default: "text"
          description: Must be one of `text` or `json_object`.

    assistantObject:
      type: object
      title: Assistant
      description: Represents an `assistant` that can call the model and use tools.
      properties:
        id:
          description: The identifier, which can be referenced in API endpoints.
          type: string
        object:
          description: The object type, which is always `assistant`.
          type: string
          enum:
            - assistant
          x-ms-enum:
            name: AssistantObjectType
            modelAsString: true
            values:
              - value: assistant
        created_at:
          type: integer
          description: The Unix timestamp (in seconds) for when the assistant was created.
        name:
          description: &assistant_name_param_description |
            The name of the assistant. The maximum length is 256 characters.
          type: string
          maxLength: 256
          nullable: true
        description:
          description: &assistant_description_param_description |
            The description of the assistant. The maximum length is 512 characters.
          type: string
          maxLength: 512
          nullable: true
        model:
          description: |
            ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
          type: string
        instructions:
          description:  &assistant_instructions_param_description |
            The system instructions that the assistant uses. The maximum length is 256,000 characters.
          type: string
          maxLength: 256000
          nullable: true
        tools:
          description: &assistant_tools_param_description |
            A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
          default: []
          type: array
          maxItems: 128
          items:
            oneOf:
              - $ref: '#/components/schemas/assistantToolsCode'
              - $ref: '#/components/schemas/assistantToolsFileSearch'
              - $ref: '#/components/schemas/assistantToolsFunction'
        tool_resources:
          type: object
          description: |
            A set of resources that are used by the assistant's tools. 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 ID of the vector store attached to this assistant. There can be a maximum of 1 vector store attached to the assistant.
                  maxItems: 1
                  items:
                    type: string
        metadata:
          description: &metadata_description |
            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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.
          type: object
          nullable: true
        temperature:
          description: &run_temperature_description |
            What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
          type: number
          minimum: 0
          maximum: 2
          default: 1
          example: 1
          nullable: true
        top_p:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          example: 1
          nullable: true
          description: &run_top_p_description |
            An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

            We generally recommend altering this or temperature but not both.
        response_format:
          $ref: "#/components/schemas/assistantsApiResponseFormatOption"
          nullable: true
      required:
        - id
        - object
        - created_at
        - name
        - description
        - model
        - instructions
        - tools
        - metadata
        
    createAssistantRequest:
      type: object
      additionalProperties: false
      properties:
        model:
          description: |
            ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
          anyOf:
            - type: string
        name:
          description: *assistant_name_param_description
          type: string
          nullable: true
          maxLength: 256
        description:
          description: *assistant_description_param_description
          type: string
          nullable: true
          maxLength: 512
        instructions:
          description: *assistant_instructions_param_description
          type: string
          nullable: true
          maxLength: 256000
        tools:
          description: *assistant_tools_param_description
          default: []
          type: array
          maxItems: 128
          items:
            oneOf:
              - $ref: '#/components/schemas/assistantToolsCode'
              - $ref: '#/components/schemas/assistantToolsFileSearch'
              - $ref: '#/components/schemas/assistantToolsFunction'
        tool_resources:
          type: object
          description: |
            A set of resources that are used by the assistant's tools. 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 assistant. There can be a maximum of 1 vector store attached to the assistant.
                  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 assistant. There can be a maximum of 1 vector store attached to the assistant.
                  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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



