PowerPlatformConnectors/independent-publisher-conne.../Mistral/apiDefinition.swagger.json

548 строки
15 KiB
JSON

{
"swagger": "2.0",
"info": {
"title": "Mistral",
"description": "Mistral is open and portable generative AI for devs and businesses. Mistral models strike an unmatched latency to performance ratio, and achieve top-tier reasoning performance on all common benchmarks. Mistral designed the models to be as unbiased and useful as possible, providing full modular control over moderation.",
"version": "1.1",
"contact": {
"name": "Troy Taylor",
"url": "https://www.hitachisolutions.com",
"email": "ttaylor@hitachisolutions.com"
},
"x-ms-keywords": [
"Mistral",
"AI",
"chat",
"completions",
"embedding"
]
},
"host": "api.mistral.ai",
"basePath": "/v1",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/chat/completions": {
"post": {
"summary": "Create chat completions",
"operationId": "CreateChatCompletion",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ChatCompletionRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ChatCompletionResponse"
}
}
},
"description": "Creates a chat completion.",
"x-ms-openai-data": {
"openai-enabled": true,
"operations": [
{
"operationId": "CreateChatCompletion",
"x-ms-require-user-confirmation": true
}
]
}
}
},
"/embeddings": {
"post": {
"summary": "Create embeddings",
"operationId": "CreateEmbedding",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/EmbeddingRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/EmbeddingResponse"
}
}
},
"description": "Creates an embedding.",
"x-ms-openai-data": {
"openai-enabled": true,
"operations": [
{
"operationId": "CreateEmbedding",
"x-ms-require-user-confirmation": true
}
]
}
}
},
"/models": {
"get": {
"summary": "List available models",
"operationId": "ListModels",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ModelList"
}
}
},
"description": "Retrieve a list of available models.",
"x-ms-openai-data": {
"openai-enabled": true,
"operations": [
{
"operationId": "ListModels",
"x-ms-require-user-confirmation": false
}
]
}
}
}
},
"definitions": {
"Error": {
"required": [
"type",
"message",
"param",
"code"
],
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "The type.",
"title": "Type"
},
"message": {
"type": "string",
"description": "The message.",
"title": "Message"
},
"param": {
"type": "string",
"description": "The parameter.",
"title": "Parameter"
},
"code": {
"type": "string",
"description": "The code.",
"title": "Code"
}
}
},
"ErrorResponse": {
"required": [
"error"
],
"type": "object",
"properties": {
"error": {
"$ref": "#/definitions/Error"
}
}
},
"ModelList": {
"required": [
"object",
"data"
],
"type": "object",
"properties": {
"object": {
"type": "string",
"description": "The object.",
"title": "Object"
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Model"
}
}
}
},
"ChatCompletionRequest": {
"required": [
"model",
"messages"
],
"type": "object",
"properties": {
"model": {
"description": "ID of the model to use.",
"type": "string",
"title": "Model",
"x-ms-dynamic-values": {
"operationId": "ListModels",
"value-path": "id",
"value-collection": "data",
"value-title": "id"
}
},
"messages": {
"description": "The prompt(s) to generate completions for, encoded as a list of dict with role and content. The first prompt role should be user or system.",
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"enum": [
"system",
"user",
"assistant",
"tool"
],
"type": "string",
"description": "The role.",
"title": "Role",
"default": "user"
},
"content": {
"type": "string",
"description": "The content.",
"title": "Content"
}
}
}
},
"temperature": {
"description": "What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.",
"title": "Temperature",
"default": 0.7,
"maximum": 1,
"minimum": 0,
"type": "number"
},
"top_p": {
"description": "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.",
"title": "Top P",
"default": 1,
"maximum": 1,
"minimum": 0,
"type": "number"
},
"max_tokens": {
"description": "The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length.",
"title": "Max Tokens",
"minimum": 0,
"type": "integer",
"format": "int32"
},
"stream": {
"description": "Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.",
"title": "Stream",
"default": false,
"type": "boolean"
},
"safe_prompt": {
"description": "Whether to inject a safety prompt before all conversations.",
"title": "Safe Prompt",
"default": false,
"type": "boolean"
},
"random_seed": {
"description": "The seed to use for random sampling. If set, different calls will generate deterministic results.",
"title": "Random Seed",
"type": "integer",
"format": "int32"
}
}
},
"ChatCompletionResponse": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
},
"object": {
"type": "string",
"description": "The object.",
"title": "Object"
},
"created": {
"type": "integer",
"format": "int32",
"description": "The created.",
"title": "Created"
},
"model": {
"type": "string",
"description": "The model.",
"title": "Model"
},
"choices": {
"type": "array",
"items": {
"required": [
"index",
"message",
"finish_reason"
],
"type": "object",
"properties": {
"index": {
"type": "integer",
"format": "int32",
"description": "The index.",
"title": "Index"
},
"message": {
"type": "object",
"properties": {
"role": {
"enum": [
"user",
"assistant"
],
"type": "string",
"description": "The role.",
"title": "Role"
},
"content": {
"type": "string",
"description": "The content.",
"title": "Content"
}
}
},
"finish_reason": {
"enum": [
"stop",
"length",
"model_length"
],
"type": "string",
"description": "The finish reason.",
"title": "Finish Reason"
}
}
}
},
"usage": {
"required": [
"prompt_tokens",
"completion_tokens",
"total_tokens"
],
"type": "object",
"properties": {
"prompt_tokens": {
"type": "integer",
"format": "int32",
"description": "The prompt tokens.",
"title": "Prompt Tokens"
},
"completion_tokens": {
"type": "integer",
"format": "int32",
"description": "The completion tokens.",
"title": "Completion Tokens"
},
"total_tokens": {
"type": "integer",
"format": "int32",
"description": "The total tokens.",
"title": "Total Tokens"
}
}
}
}
},
"EmbeddingRequest": {
"type": "object",
"properties": {
"model": {
"description": "The ID of the model to use for this request.",
"type": "string",
"title": "model",
"default": "mistral-embed"
},
"input": {
"description": "The list of strings to embed.",
"type": "array",
"title": "Input",
"items": {
"type": "string"
}
},
"encoding_format": {
"description": "The format of the output data.",
"enum": [
"float"
],
"type": "string",
"title": "Encoding Format"
}
}
},
"EmbeddingResponse": {
"required": [
"id",
"object",
"data",
"model",
"usage"
],
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
},
"object": {
"type": "string",
"description": "The object.",
"title": "Object"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"object": {
"type": "string",
"description": "The object.",
"title": "Object"
},
"embedding": {
"type": "array",
"description": "The embedding.",
"title": "Embedding",
"items": {
"type": "number",
"format": "double"
}
},
"index": {
"type": "integer",
"description": "The index.",
"title": "Index"
}
}
}
},
"model": {
"type": "string",
"description": "The model.",
"title": "Model"
},
"usage": {
"required": [
"prompt_tokens",
"total_tokens"
],
"type": "object",
"properties": {
"prompt_tokens": {
"type": "integer",
"format": "int32",
"description": "The prompt tokens.",
"title": "Prompt Tokens"
},
"total_tokens": {
"type": "integer",
"format": "int32",
"description": "The total tokens.",
"title": "Total Tokens"
}
}
}
}
},
"Model": {
"title": "Model",
"required": [
"id",
"object",
"created",
"owned_by"
],
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
},
"object": {
"type": "string",
"description": "The object.",
"title": "Object"
},
"created": {
"type": "integer",
"format": "int32",
"description": "The created.",
"title": "Created"
},
"owned_by": {
"type": "string",
"description": "The owned by.",
"title": "Owned By"
}
}
}
},
"parameters": {},
"responses": {},
"securityDefinitions": {
"API Key": {
"type": "apiKey",
"in": "header",
"name": "Authorization"
}
},
"security": [
{
"API Key": []
}
],
"tags": [],
"x-ms-openai-manifest": {
"humanName": "Mistral",
"modelDescription": "This is a Copilot plugin for the Mistral AI service.",
"contactEmail": "ttaylor@hitachisolutions.com"
},
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://mistral.ai/"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://mistral.ai/terms#privacy-policy"
},
{
"propertyName": "Categories",
"propertyValue": "AI"
}
]
}