swagger: '2.0' info: version: 2020-08-01-preview title: Microsoft Azure AccessControlClient AccessConnector Completions API description: Operations for text completions schemes: - https tags: - name: Completions description: Operations for text completions paths: /deployments/{deployment-id}/completions: post: operationId: Completions_Create summary: Microsoft Azure Create a Text Completion description: Creates a completion for the provided prompt and parameters. tags: - Completions parameters: - $ref: '#/components/parameters/DeploymentIdParameter' - $ref: '#/components/parameters/ApiVersionParameter' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateCompletionRequest' examples: CompletionsCreateRequestExample: summary: Default Completions_Create request x-microcks-default: true value: prompt: example_value max_tokens: 10 temperature: 42.5 top_p: 42.5 n: 10 stream: true stop: example_value presence_penalty: 42.5 frequency_penalty: 42.5 user: example_value responses: '200': description: Successfully created a completion. content: application/json: schema: $ref: '#/components/schemas/CreateCompletionResponse' examples: CompletionsCreate200Example: summary: Default Completions_Create 200 response x-microcks-default: true value: id: abc123 object: text_completion created: 10 model: example_value choices: - text: example_value index: 10 finish_reason: stop usage: prompt_tokens: 10 completion_tokens: 10 total_tokens: 10 default: description: An error occurred. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: CompletionsCreatedefaultExample: summary: Default Completions_Create default response x-microcks-default: true value: error: code: example_value message: example_value param: example_value type: example_value inner_error: code: example_value content_filter_result: example_value x-microcks-operation: delay: 0 dispatcher: FALLBACK components: parameters: DeploymentIdParameter: name: deployment-id in: path required: true description: The deployment ID of the model to use for this request. schema: type: string ApiVersionParameter: name: api-version in: query required: true description: The API version to use for this operation. schema: type: string default: '2024-06-01' schemas: Usage: type: object description: Usage statistics for the API call. properties: prompt_tokens: type: integer description: Number of tokens in the prompt. example: 10 completion_tokens: type: integer description: Number of tokens in the generated completion. example: 10 total_tokens: type: integer description: Total number of tokens used in the request. example: 10 required: - prompt_tokens - total_tokens CreateCompletionRequest: type: object description: Request body for creating a text completion. properties: prompt: description: The prompt(s) to generate completions for. oneOf: - type: string - type: array items: type: string example: example_value max_tokens: type: integer default: 16 description: The maximum number of tokens that can be generated. example: 10 temperature: type: number default: 1 minimum: 0 maximum: 2 description: Sampling temperature to use. example: 42.5 top_p: type: number default: 1 minimum: 0 maximum: 1 description: Nucleus sampling parameter. example: 42.5 n: type: integer default: 1 minimum: 1 maximum: 128 description: How many completions to generate for each prompt. example: 10 stream: type: boolean default: false description: Whether to stream back partial progress. example: true stop: description: Up to 4 sequences where the API will stop generating further tokens. oneOf: - type: string - type: array items: type: string maxItems: 4 example: example_value presence_penalty: type: number default: 0 minimum: -2 maximum: 2 description: Penalizes new tokens based on whether they appear in the text so far. example: 42.5 frequency_penalty: type: number default: 0 minimum: -2 maximum: 2 description: Penalizes new tokens based on their existing frequency in the text. example: 42.5 user: type: string description: A unique identifier representing your end-user. example: example_value required: - prompt ErrorResponse: type: object description: Error response. properties: error: type: object description: The error object. properties: code: type: string description: The error code. message: type: string description: The error message. param: type: string description: The parameter that caused the error. type: type: string description: The error type. inner_error: type: object description: Inner error details. properties: code: type: string description: The inner error code. content_filter_result: type: object description: Content filter results, if applicable. required: - code - message example: example_value CreateCompletionResponse: type: object description: Represents a completion response from the API. properties: id: type: string description: A unique identifier for the completion. example: abc123 object: type: string enum: - text_completion description: The object type. example: text_completion created: type: integer description: The Unix timestamp of when the completion was created. example: 10 model: type: string description: The model used for completion. example: example_value choices: type: array description: The list of completion choices. items: type: object properties: text: type: string description: The generated text. index: type: integer description: The index of the choice. finish_reason: type: string enum: - stop - length - content_filter description: The reason the model stopped generating tokens. example: [] usage: $ref: '#/components/schemas/Usage' required: - id - object - created - model - choices x-ms-parameterized-host: hostTemplate: '{endpoint}' useSchemePrefix: false parameters: - $ref: '#/parameters/Endpoint'