diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 7e21a8b6d3..a2799552e4 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -117,7 +117,6 @@ const config = { requiredPropsFirst: true, noAutoAuth: true, hideDownloadButton: true, - disableSearch: true, }, }, }, diff --git a/docs/openapi/jan.yaml b/docs/openapi/jan.yaml index ed558d14d3..6a59647e51 100644 --- a/docs/openapi/jan.yaml +++ b/docs/openapi/jan.yaml @@ -1,28 +1,32 @@ openapi: 3.0.0 info: title: API Reference - description: | + description: > # Introduction - Jan API is compatible with the [OpenAI API](https://platform.openai.com/docs/api-reference). -version: "0.1.8" + + Jan API is compatible with the [OpenAI + API](https://platform.openai.com/docs/api-reference). +version: 0.1.8 contact: name: Jan Discord - url: https://discord.gg/7EcEz7MrvA + url: "https://discord.gg/7EcEz7MrvA" license: name: AGPLv3 - url: https://github.com/janhq/nitro/blob/main/LICENSE + url: "https://github.com/janhq/nitro/blob/main/LICENSE" servers: - - url: https://localhost:1337/v1/ + - url: "https://localhost:1337/v1/" tags: - name: Models description: List and describe the various models available in the API. - name: Chat - description: | - Given a list of messages comprising a conversation, the model will return a response. - + description: > + Given a list of messages comprising a conversation, the model will return + a response. - name: Messages - description: | - Messages capture a conversation's content. This can include the content from LLM responses and other metadata from [chat completions](/specs/chats). + description: > + Messages capture a conversation's content. This can include the content + from LLM responses and other metadata from [chat + completions](/specs/chats). - name: Threads - name: Assistants description: Configures and utilizes different AI assistants for varied tasks @@ -44,8 +48,10 @@ paths: - Chat summary: | Create chat completion - description: | - Creates a model response for the given chat conversation. Equivalent to OpenAI's create chat completion. + description: > + Creates a model response for the given chat conversation. Equivalent + to OpenAI's create chat completion. requestBody: content: application/json: @@ -59,9 +65,10 @@ paths: schema: $ref: "specs/chat.yaml#/components/schemas/ChatCompletionResponse" x-codeSamples: - - lang: "curl" - source: | - curl -X POST 'http://localhost:3982/inferences/llamacpp/chat_completion' \ + - lang: cURL + source: > + curl -X POST + 'http://localhost:3982/inferences/llamacpp/chat_completion' \ -H "Content-Type: application/json" \ -d '{ "llama_model_path": "/path/to/your/model.gguf", @@ -72,16 +79,17 @@ paths: }, ] }' - - ### MODELS /models: get: operationId: listModels tags: - Models summary: List models - description: | - Lists the currently available models, and provides basic information about each one such as the owner and availability. Equivalent to OpenAI's list model. + description: > + Lists the currently available models, and provides basic information + about each one such as the owner and availability. Equivalent + to OpenAI's list model. responses: "200": description: OK @@ -90,7 +98,7 @@ paths: schema: $ref: "specs/models.yaml#/components/schemas/ListModelsResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl https://localhost:1337/v1/models post: @@ -108,27 +116,29 @@ paths: schema: $ref: "specs/models.yaml#/components/schemas/DownloadModelResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl -X POST https://localhost:1337/v1/models - /models/{model_id}: + "/models/{model_id}": get: operationId: retrieveModel tags: - Models summary: Retrieve model - description: | - Get a model instance, providing basic information about the model such as the owner and permissioning. Equivalent to OpenAI's retrieve model. + description: > + Get a model instance, providing basic information about the model such + as the owner and permissioning. + Equivalent to OpenAI's retrieve model. parameters: - in: path name: model_id required: true schema: type: string - # ideally this will be an actual ID, so this will always work from browser example: zephyr-7b description: | - The ID of the model to use for this request + The ID of the model to use for this request. responses: "200": description: OK @@ -137,7 +147,7 @@ paths: schema: $ref: "specs/models.yaml#/components/schemas/GetModelResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl https://localhost:1337/v1/models/{model_id} delete: @@ -145,8 +155,10 @@ paths: tags: - Models summary: Delete model - description: | - Delete a model. Equivalent to OpenAI's delete model. + description: > + Delete a model. + Equivalent to OpenAI's delete model. parameters: - in: path name: model @@ -164,10 +176,10 @@ paths: schema: $ref: "specs/models.yaml#/components/schemas/DeleteModelResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl -X DELETE https://localhost:1337/v1/models/{model_id} - /models/{model_id}/start: + "/models/{model_id}/start": put: operationId: startModel tags: @@ -181,7 +193,6 @@ paths: required: true schema: type: string - # ideally this will be an actual ID, so this will always work from browser example: zephyr-7b description: | The ID of the model to use for this request @@ -193,10 +204,10 @@ paths: schema: $ref: "specs/models.yaml#/components/schemas/StartModelResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl -X PUT https://localhost:1337/v1/models/{model_id}/start - /models/{model_id}/stop: + "/models/{model_id}/stop": put: operationId: stopModel tags: @@ -210,7 +221,6 @@ paths: required: true schema: type: string - # ideally this will be an actual ID, so this will always work from browser example: zephyr-7b description: The ID of the model to use for this request responses: @@ -221,19 +231,19 @@ paths: schema: $ref: "specs/models.yaml#/components/schemas/StopModelResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl -X PUT https://localhost:1337/v1/models/{model_id}/stop - - ### THREADS /threads: post: operationId: createThread tags: - Threads summary: Create thread - description: | - Create a thread. Equivalent to OpenAI's create thread. + description: > + Create a thread. + Equivalent to OpenAI's create thread. requestBody: required: false content: @@ -243,7 +253,7 @@ paths: properties: messages: type: array - description: "Initial set of messages for the thread." + description: Initial set of messages for the thread. items: $ref: "specs/threads.yaml#/components/schemas/ThreadMessageObject" responses: @@ -254,7 +264,7 @@ paths: schema: $ref: "specs/threads.yaml#/components/schemas/CreateThreadResponse" x-codeSamples: - - lang: "cURL" + - lang: cURL source: | curl -X POST http://localhost:1337/v1/threads \ -H "Content-Type: application/json" \ @@ -285,31 +295,36 @@ paths: items: $ref: "specs/threads.yaml#/components/schemas/ThreadObject" example: - - id: "thread_abc123" - object: "thread" + - id: thread_abc123 + object: thread created_at: 1699014083 - assistants: ["assistant-001"] + assistants: + - assistant-001 metadata: {} messages: [] - - id: "thread_abc456" - object: "thread" + - id: thread_abc456 + object: thread created_at: 1699014083 - assistants: ["assistant-002", "assistant-003"] + assistants: + - assistant-002 + - assistant-003 metadata: {} x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl http://localhost:1337/v1/threads \ -H "Content-Type: application/json" \ - - /threads/{thread_id}: + "/threads/{thread_id}": get: operationId: getThread tags: - Threads summary: Retrieve thread - description: | - Retrieves detailed information about a specific thread using its thread_id. Equivalent to OpenAI's retrieve thread. + description: > + Retrieves detailed information about a specific thread using its + thread_id. + Equivalent to OpenAI's retrieve thread. parameters: - in: path name: thread_id @@ -319,7 +334,6 @@ paths: example: thread_abc123 description: | The ID of the thread to retrieve. - responses: "200": description: Thread details retrieved successfully @@ -328,7 +342,7 @@ paths: schema: $ref: "specs/threads.yaml#/components/schemas/GetThreadResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl http://localhost:1337/v1/threads/{thread_id} post: @@ -336,8 +350,10 @@ paths: tags: - Threads summary: Modify thread - description: | - Modifies a thread. Equivalent to OpenAI's modify thread. + description: > + Modifies a thread. + Equivalent to OpenAI's modify thread. parameters: - in: path name: thread_id @@ -347,7 +363,6 @@ paths: example: thread_abc123 description: | The ID of the thread to be modified. - requestBody: required: false content: @@ -357,7 +372,7 @@ paths: properties: messages: type: array - description: "Set of messages to update in the thread." + description: Set of messages to update in the thread. items: $ref: "specs/threads.yaml#/components/schemas/ThreadMessageObject" responses: @@ -368,7 +383,7 @@ paths: schema: $ref: "specs/threads.yaml#/components/schemas/ModifyThreadResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl -X POST http://localhost:1337/v1/threads/{thread_id} \ -H "Content-Type: application/json" \ @@ -387,8 +402,10 @@ paths: tags: - Threads summary: Delete thread - description: | - Delete a thread. Equivalent to OpenAI's delete thread. + description: > + Delete a thread. + Equivalent to OpenAI's delete thread. parameters: - in: path name: thread_id @@ -406,18 +423,17 @@ paths: schema: $ref: "specs/threads.yaml#/components/schemas/DeleteThreadResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl -X DELETE http://localhost:1337/v1/threads/{thread_id} - - /threads/{thread_id}/assistants: + "/threads/{thread_id}/assistants": get: operationId: getThreadAssistants tags: - Threads summary: Get Thread.Assistants description: | - Can achieve this goal by calling Get thread API + Can achieve this goal by calling Get thread API. parameters: - in: path name: thread_id @@ -434,29 +450,26 @@ paths: schema: $ref: "specs/threads.yaml#/components/schemas/GetThreadResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl http://localhost:1337/v1/threads/{thread_id}/assistants - - /threads/{thread_id}/assistants/{assistants_id}: + "/threads/{thread_id}/assistants/{assistants_id}": post: operationId: postThreadAssistants tags: - Threads summary: Modify Thread.Assistants - description: | - - - Can achieve this goal by calling Modify Assistant API with thread.assistant[] - - /threads/{thread_id}/: + description: > + Can achieve this goal by calling Modify Assistant API with + thread.assistant[]. + "/threads/{thread_id}/": get: operationId: listThreadMessage tags: - Threads summary: List Thread.Messages description: | - Can achieve this goal by calling Get Thread API + Can achieve this goal by calling Get Thread API. parameters: - in: path name: thread_id @@ -473,20 +486,20 @@ paths: schema: $ref: "specs/threads.yaml#/components/schemas/GetThreadResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl http://localhost:1337/v1/threads/{thread_id} - ### ASSISTANTS /assistants/: get: operationId: listAssistants tags: - Assistants summary: List assistants - description: | - Return a list of assistants. Equivalent to OpenAI's list assistants. + description: > + Return a list of assistants. + Equivalent to OpenAI's list assistants. responses: - responses: "200": description: List of threads retrieved successfully content: @@ -494,37 +507,37 @@ paths: schema: type: array example: - - id: "asst_abc123" - object: "assistant" + - id: asst_abc123 + object: assistant version: 1 created_at: 1698984975 - name: "Math Tutor" + name: Math Tutor description: null avatar: "https://pic.png" models: - - model_id: "model_0" - instructions: "Be concise" + - model_id: model_0 + instructions: Be concise events: in: [] out: [] metadata: {} - - - id: "asst_abc456" - object: "assistant" + - id: asst_abc456 + object: assistant version: 1 created_at: 1698984975 - name: "Physics Tutor" + name: Physics Tutor description: null avatar: "https://pic.png" models: - - model_id: "model_1" - instructions: "Be concise!" + - model_id: model_1 + instructions: Be concise! events: in: [] out: [] metadata: {} + responses: null x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl http://localhost:1337/v1/assistants \ -H "Content-Type: application/json" \ @@ -533,8 +546,10 @@ paths: tags: - Assistants summary: Create assistant - description: | - Create an assistant with a model and instructions. Equivalent to OpenAI's create assistants. + description: > + Create an assistant with a model and instructions. + Equivalent to OpenAI's create assistants. requestBody: required: true content: @@ -544,7 +559,9 @@ paths: properties: models: type: array - description: "List of models associated with the assistant. Jan-specific property." + description: >- + List of models associated with the assistant. Jan-specific + property. items: type: object properties: @@ -553,13 +570,14 @@ paths: example: model_0 responses: "200": - description: + description: null content: application/json: schema: - $ref: "specs/assistants.yaml#/components/schemas/CreateAssistantResponse" + $ref: >- + specs/assistants.yaml#/components/schemas/CreateAssistantResponse x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl http://localhost:1337/v1/assistants \ -H "Content-Type: application/json" \ @@ -570,14 +588,16 @@ paths: } ] }' - /assistants/{assistant_id}: + "/assistants/{assistant_id}": get: operationId: getAssistant tags: - Assistants summary: Retrieve assistant - description: | - Retrieves an assistant. Equivalent to OpenAI's retrieve assistants. + description: > + Retrieves an assistant. + Equivalent to OpenAI's retrieve assistants. parameters: - in: path name: assistant_id @@ -589,13 +609,14 @@ paths: The ID of the assistant to retrieve. responses: "200": - description: + description: null content: application/json: schema: - $ref: "specs/assistants.yaml#/components/schemas/RetrieveAssistantResponse" + $ref: >- + specs/assistants.yaml#/components/schemas/RetrieveAssistantResponse x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl http://localhost:1337/v1/assistants/{assistant_id} \ -H "Content-Type: application/json" \ @@ -604,8 +625,10 @@ paths: tags: - Assistants summary: Modify assistant - description: | - Modifies an assistant. Equivalent to OpenAI's modify assistant. + description: > + Modifies an assistant. + Equivalent to OpenAI's modify assistant. parameters: - in: path name: assistant_id @@ -624,7 +647,9 @@ paths: properties: models: type: array - description: "List of models associated with the assistant. Jan-specific property." + description: >- + List of models associated with the assistant. Jan-specific + property. items: type: object properties: @@ -633,21 +658,22 @@ paths: example: model_0 name: type: string - description: "Name of the assistant." - example: "Physics Tutor" + description: Name of the assistant. + example: Physics Tutor instructions: type: string - description: "A system prompt for the assistant." + description: A system prompt for the assistant. example: Be concise! responses: "200": - description: + description: null content: application/json: schema: - $ref: "specs/assistants.yaml#/components/schemas/ModifyAssistantResponse" + $ref: >- + specs/assistants.yaml#/components/schemas/ModifyAssistantResponse x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl http://localhost:1337/v1/assistants/{assistant_id} \ -H "Content-Type: application/json" \ @@ -660,14 +686,15 @@ paths: "name": "Physics Tutor", "instructions": "Be concise!", }' - delete: operationId: deleteAssistant tags: - Assistants summary: Delete assistant - description: | - Delete an assistant. Equivalent to OpenAI's delete assistant. + description: > + Delete an assistant. + Equivalent to OpenAI's delete assistant. parameters: - in: path name: assistant_id @@ -683,21 +710,22 @@ paths: content: application/json: schema: - $ref: "specs/assistants.yaml#/components/schemas/DeleteAssistantResponse" + $ref: >- + specs/assistants.yaml#/components/schemas/DeleteAssistantResponse x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl -X DELETE http://localhost:1337/v1/assistants/{assistant_id} - - ### MESSAGES - /threads/{thread_id}/messages: + "/threads/{thread_id}/messages": get: operationId: listMessages tags: - Messages summary: List messages - description: | - Retrieves all messages from the given thread. Equivalent to OpenAI's list messages. + description: > + Retrieves all messages from the given thread. + Equivalent to OpenAI's list messages. parameters: - in: path name: thread_id @@ -715,7 +743,7 @@ paths: schema: $ref: "specs/messages.yaml#/components/schemas/ListMessagesResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl http://localhost:1337/v1/threads/{thread_id}/messages \ -H "Content-Type: application/json" @@ -724,8 +752,10 @@ paths: tags: - Messages summary: Create message - description: | - Create a message. Equivalent to OpenAI's list messages. + description: > + Create a message. + Equivalent to OpenAI's list messages. parameters: - in: path name: thread_id @@ -746,8 +776,10 @@ paths: type: string description: | Role of the sender, either 'user' or 'assistant'. - example: "user" - enum: ["user", "assistant"] + example: user + enum: + - user + - assistant content: type: string description: | @@ -764,7 +796,7 @@ paths: schema: $ref: "specs/messages.yaml#/components/schemas/CreateMessageResponse" x-codeSamples: - - lang: "curl" + - lang: cURL source: | curl -X POST http://localhost:1337/v1/threads/{thread_id}/messages \ -H "Content-Type: application/json" \ @@ -772,15 +804,17 @@ paths: "role": "user", "content": "How does AI work? Explain it in simple terms." }' - - /threads/{thread_id}/messages/{message_id}: + "/threads/{thread_id}/messages/{message_id}": get: operationId: retrieveMessage tags: - Messages summary: Retrieve message - description: | - Retrieve a specific message from a thread using its thread_id and message_id. Equivalent to OpenAI's retrieve messages. + description: > + Retrieve a specific message from a thread using its thread_id and + message_id. + Equivalent to OpenAI's retrieve messages. parameters: - in: path name: thread_id @@ -798,7 +832,6 @@ paths: example: msg_abc123 description: | The ID of the message to retrieve. - responses: "200": description: OK @@ -807,20 +840,22 @@ paths: schema: $ref: "specs/messages.yaml#/components/schemas/GetMessageResponse" x-codeSamples: - - lang: "curl" - source: | - curl http://localhost:1337/v1/threads/{thread_id}/messages/{message_id} \ + - lang: cURL + source: > + curl + http://localhost:1337/v1/threads/{thread_id}/messages/{message_id} \ -H "Content-Type: application/json" - - /threads/{thread_id}/messages/{message_id}/files: + "/threads/{thread_id}/messages/{message_id}/files": get: operationId: listMessageFiles tags: - Messages summary: | List message files - description: | - Returns a list of message files. Equivalent to OpenAI's list message files. + description: > + Returns a list of message files. + Equivalent to OpenAI's list message files. parameters: - in: path name: thread_id @@ -830,7 +865,6 @@ paths: example: thread_abc123 description: | The ID of the thread containing the message. - - in: path name: message_id required: true @@ -839,28 +873,32 @@ paths: example: msg_abc123 description: | The ID of the message whose files are to be listed. - responses: "200": description: List of files retrieved successfully content: application/json: schema: - $ref: "specs/messages.yaml#/components/schemas/ListMessageFilesResponse" + $ref: >- + specs/messages.yaml#/components/schemas/ListMessageFilesResponse x-codeSamples: - - lang: "curl" - source: | - curl http://localhost:1337/v1/threads/{thread_id}/messages/{message_id}/files \ + - lang: cURL + source: > + curl + http://localhost:1337/v1/threads/{thread_id}/messages/{message_id}/files + \ -H "Content-Type: application/json" - - /threads/{thread_id}/messages/{message_id}/files/{file_id}: + "/threads/{thread_id}/messages/{message_id}/files/{file_id}": get: operationId: retrieveMessageFile tags: - Messages summary: Retrieve message file - description: | - Retrieves a file associated with a specific message in a thread. Equivalent to OpenAI's retrieve message file. + description: > + Retrieves a file associated with a specific message in a thread. + Equivalent to OpenAI's retrieve message file. parameters: - in: path name: thread_id @@ -870,7 +908,6 @@ paths: example: thread_abc123 description: | The ID of the thread containing the message. - - in: path name: message_id required: true @@ -879,7 +916,6 @@ paths: example: msg_abc123 description: | The ID of the message associated with the file. - - in: path name: file_id required: true @@ -888,7 +924,6 @@ paths: example: file-abc123 description: | The ID of the file to retrieve. - responses: "200": description: File retrieved successfully @@ -897,17 +932,20 @@ paths: schema: $ref: "specs/messages.yaml#/components/schemas/MessageFileObject" x-codeSamples: - - lang: "curl" - source: | - curl http://localhost:1337/v1/threads/{thread_id}/messages/{message_id}/files/{file_id} \ + - lang: cURL + source: > + curl + http://localhost:1337/v1/threads/{thread_id}/messages/{message_id}/files/{file_id} + \ -H "Content-Type: application/json" - x-webhooks: ModelObject: post: summary: The model object - description: | - Describe a model offering that can be used with the API. Equivalent to OpenAI's model object. + description: > + Describe a model offering that can be used with the API. + Equivalent to OpenAI's model object. operationId: ModelObject tags: - Models @@ -919,8 +957,10 @@ x-webhooks: AssistantObject: post: summary: The assistant object - description: | - Build assistants that can call models and use tools to perform tasks. Equivalent to OpenAI's assistants object. + description: > + Build assistants that can call models and use tools to perform tasks. + + Equivalent to OpenAI's assistants object. operationId: AssistantObjects tags: - Assistants @@ -932,8 +972,10 @@ x-webhooks: MessageObject: post: summary: The message object - description: | - Information about a message in the thread. Equivalent to OpenAI's message object. + description: > + Information about a message in the thread. + Equivalent to OpenAI's message object. operationId: MessageObject tags: - Messages @@ -945,7 +987,10 @@ x-webhooks: ThreadObject: post: summary: The thread object - description: Represents a thread that contains messages. Equivalent to OpenAI's thread object. + description: >- + Represents a thread that contains messages. + Equivalent to OpenAI's thread object. operationId: ThreadObject tags: - Threads diff --git a/docs/openapi/specs/assistants.yaml b/docs/openapi/specs/assistants.yaml index 687fb12ff4..7579f35aec 100644 --- a/docs/openapi/specs/assistants.yaml +++ b/docs/openapi/specs/assistants.yaml @@ -5,36 +5,36 @@ components: properties: id: type: string - description: "The identifier of the assistant." - example: "asst_abc123" + description: The identifier of the assistant. + example: asst_abc123 object: type: string description: "Type of the object, indicating it's an assistant." - default: "assistant" + default: assistant version: type: integer - description: "Version number of the assistant." + description: Version number of the assistant. example: 1 created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the assistant." + description: Unix timestamp representing the creation time of the assistant. example: 1698984975 name: type: string - description: "Name of the assistant." - example: "Math Tutor" + description: Name of the assistant. + example: Math Tutor description: type: string - description: "Description of the assistant. Can be null." + description: Description of the assistant. Can be null. example: null avatar: type: string - description: "URL of the assistant's avatar. Jan-specific property." + description: URL of the assistant's avatar. Jan-specific property. example: "https://pic.png" models: type: array - description: "List of models associated with the assistant. Jan-specific property." + description: List of models associated with the assistant. Jan-specific property. items: type: object properties: @@ -43,11 +43,11 @@ components: example: model_0 instructions: type: string - description: "A system prompt for the assistant." + description: A system prompt for the assistant. example: Be concise events: type: object - description: "Event subscription settings for the assistant." + description: Event subscription settings for the assistant. properties: in: type: array @@ -57,48 +57,45 @@ components: type: array items: type: string - # If there are specific event types, they can be detailed here metadata: type: object - description: "Metadata associated with the assistant." - - ListAssistantsResponse: - + description: Metadata associated with the assistant. + ListAssistantsResponse: null CreateAssistantResponse: type: object properties: id: type: string - description: "The identifier of the assistant." - example: "asst_abc123" + description: The identifier of the assistant. + example: asst_abc123 object: type: string description: "Type of the object, indicating it's an assistant." - default: "assistant" + default: assistant version: type: integer - description: "Version number of the assistant." + description: Version number of the assistant. example: 1 created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the assistant." + description: Unix timestamp representing the creation time of the assistant. example: 1698984975 name: type: string - description: "Name of the assistant." - example: "Math Tutor" + description: Name of the assistant. + example: Math Tutor description: type: string - description: "Description of the assistant. Can be null." + description: Description of the assistant. Can be null. example: null avatar: type: string - description: "URL of the assistant's avatar. Jan-specific property." + description: URL of the assistant's avatar. Jan-specific property. example: "https://pic.png" models: type: array - description: "List of models associated with the assistant. Jan-specific property." + description: List of models associated with the assistant. Jan-specific property. items: type: object properties: @@ -107,11 +104,11 @@ components: example: model_0 instructions: type: string - description: "A system prompt for the assistant." + description: A system prompt for the assistant. example: Be concise events: type: object - description: "Event subscription settings for the assistant." + description: Event subscription settings for the assistant. properties: in: type: array @@ -121,46 +118,44 @@ components: type: array items: type: string - # If there are specific event types, they can be detailed here metadata: type: object - description: "Metadata associated with the assistant." - + description: Metadata associated with the assistant. RetrieveAssistantResponse: type: object properties: id: type: string - description: "The identifier of the assistant." - example: "asst_abc123" + description: The identifier of the assistant. + example: asst_abc123 object: type: string description: "Type of the object, indicating it's an assistant." - default: "assistant" + default: assistant version: type: integer - description: "Version number of the assistant." + description: Version number of the assistant. example: 1 created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the assistant." + description: Unix timestamp representing the creation time of the assistant. example: 1698984975 name: type: string - description: "Name of the assistant." - example: "Math Tutor" + description: Name of the assistant. + example: Math Tutor description: type: string - description: "Description of the assistant. Can be null." + description: Description of the assistant. Can be null. example: null avatar: type: string - description: "URL of the assistant's avatar. Jan-specific property." + description: URL of the assistant's avatar. Jan-specific property. example: "https://pic.png" models: type: array - description: "List of models associated with the assistant. Jan-specific property." + description: List of models associated with the assistant. Jan-specific property. items: type: object properties: @@ -169,11 +164,11 @@ components: example: model_0 instructions: type: string - description: "A system prompt for the assistant." + description: A system prompt for the assistant. example: Be concise events: type: object - description: "Event subscription settings for the assistant." + description: Event subscription settings for the assistant. properties: in: type: array @@ -183,46 +178,44 @@ components: type: array items: type: string - # If there are specific event types, they can be detailed here metadata: type: object - description: "Metadata associated with the assistant." - + description: Metadata associated with the assistant. ModifyAssistantObject: type: object properties: id: type: string - description: "The identifier of the assistant." - example: "asst_abc123" + description: The identifier of the assistant. + example: asst_abc123 object: type: string description: "Type of the object, indicating it's an assistant." - default: "assistant" + default: assistant version: type: integer - description: "Version number of the assistant." + description: Version number of the assistant. example: 1 created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the assistant." + description: Unix timestamp representing the creation time of the assistant. example: 1698984975 name: type: string - description: "Name of the assistant." - example: "Math Tutor" + description: Name of the assistant. + example: Math Tutor description: type: string - description: "Description of the assistant. Can be null." + description: Description of the assistant. Can be null. example: null avatar: type: string - description: "URL of the assistant's avatar. Jan-specific property." + description: URL of the assistant's avatar. Jan-specific property. example: "https://pic.png" models: type: array - description: "List of models associated with the assistant. Jan-specific property." + description: List of models associated with the assistant. Jan-specific property. items: type: object properties: @@ -231,11 +224,11 @@ components: example: model_0 instructions: type: string - description: "A system prompt for the assistant." + description: A system prompt for the assistant. example: Be concise events: type: object - description: "Event subscription settings for the assistant." + description: Event subscription settings for the assistant. properties: in: type: array @@ -245,46 +238,44 @@ components: type: array items: type: string - # If there are specific event types, they can be detailed here metadata: type: object - description: "Metadata associated with the assistant." - + description: Metadata associated with the assistant. ModifyAssistantResponse: type: object properties: id: type: string - description: "The identifier of the assistant." - example: "asst_abc123" + description: The identifier of the assistant. + example: asst_abc123 object: type: string description: "Type of the object, indicating it's an assistant." - default: "assistant" + default: assistant version: type: integer - description: "Version number of the assistant." + description: Version number of the assistant. example: 1 created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the assistant." + description: Unix timestamp representing the creation time of the assistant. example: 1698984975 name: type: string - description: "Name of the assistant." - example: "Physics Tutor" + description: Name of the assistant. + example: Physics Tutor description: type: string - description: "Description of the assistant. Can be null." + description: Description of the assistant. Can be null. example: null avatar: type: string - description: "URL of the assistant's avatar. Jan-specific property." + description: URL of the assistant's avatar. Jan-specific property. example: "https://pic.png" models: type: array - description: "List of models associated with the assistant. Jan-specific property." + description: List of models associated with the assistant. Jan-specific property. items: type: object properties: @@ -293,11 +284,11 @@ components: example: model_0 instructions: type: string - description: "A system prompt for the assistant." + description: A system prompt for the assistant. example: Be concise! events: type: object - description: "Event subscription settings for the assistant." + description: Event subscription settings for the assistant. properties: in: type: array @@ -307,17 +298,15 @@ components: type: array items: type: string - # If there are specific event types, they can be detailed here metadata: type: object - description: "Metadata associated with the assistant." - + description: Metadata associated with the assistant. DeleteAssistantResponse: type: object properties: id: type: string - description: "The identifier of the deleted assistant." + description: The identifier of the deleted assistant. example: asst_abc123 object: type: string @@ -325,5 +314,5 @@ components: example: assistant.deleted deleted: type: boolean - description: "Indicates whether the assistant was successfully deleted." + description: Indicates whether the assistant was successfully deleted. example: true diff --git a/docs/openapi/specs/chat.yaml b/docs/openapi/specs/chat.yaml index 166a6bd6ce..9303e9713a 100644 --- a/docs/openapi/specs/chat.yaml +++ b/docs/openapi/specs/chat.yaml @@ -6,48 +6,59 @@ components: messages: type: arrays description: | - Contains input data or prompts for the model to process + Contains input data or prompts for the model to process. example: - [ - { "content": "Hello there :wave:", "role": "assistant" }, - { "content": "Can you write a long story", "role": "user" }, - ] + - content: "Hello there :wave:" + role: assistant + - content: Can you write a long story + role: user stream: type: boolean default: true - description: Enables continuous output generation, allowing for streaming of model responses + description: >- + Enables continuous output generation, allowing for streaming of + model responses. model: type: string - example: "gpt-3.5-turbo" - description: Specifies the model being used for inference or processing tasks + example: gpt-3.5-turbo + description: Specifies the model being used for inference or processing tasks. max_tokens: type: number default: 2048 - description: The maximum number of tokens the model will generate in a single response + description: >- + The maximum number of tokens the model will generate in a single + response. stop: type: arrays - example: ["hello"] - description: Defines specific tokens or phrases at which the model will stop generating further output + example: + - hello + description: >- + Defines specific tokens or phrases at which the model will stop + generating further output/ frequency_penalty: type: number default: 0 - description: Adjusts the likelihood of the model repeating words or phrases in its output + description: >- + Adjusts the likelihood of the model repeating words or phrases in + its output. presence_penalty: type: number default: 0 - description: Influences the generation of new and varied concepts in the model's output + description: >- + Influences the generation of new and varied concepts in the model's + output. temperature: type: number default: 0.7 min: 0 max: 1 - description: Controls the randomness of the model's output + description: Controls the randomness of the model's output. top_p: type: number default: 0.95 min: 0 max: 1 - description: Set probability threshold for more relevant outputs + description: Set probability threshold for more relevant outputs. cache_prompt: type: boolean default: true @@ -58,57 +69,62 @@ components: messages: type: arrays description: | - Contains input data or prompts for the model to process + Contains input data or prompts for the model to process. example: - [ - { "content": "Hello there :wave:", "role": "assistant" }, - { "content": "Can you write a long story", "role": "user" }, - ] + - content: "Hello there :wave:" + role: assistant + - content: Can you write a long story + role: user model: type: string example: model-zephyr-7B description: | - Specifies the model being used for inference or processing tasks + Specifies the model being used for inference or processing tasks. stream: type: boolean default: true - description: | - Enables continuous output generation, allowing for streaming of model responses + description: > + Enables continuous output generation, allowing for streaming of + model responses. max_tokens: type: number default: 2048 - description: | - The maximum number of tokens the model will generate in a single response + description: > + The maximum number of tokens the model will generate in a single + response. stop: type: arrays - example: ["hello"] - description: | - Defines specific tokens or phrases at which the model will stop generating further output + example: + - hello + description: > + Defines specific tokens or phrases at which the model will stop + generating further output. frequency_penalty: type: number default: 0 - description: | - Adjusts the likelihood of the model repeating words or phrases in its output + description: > + Adjusts the likelihood of the model repeating words or phrases in + its output. presence_penalty: type: number default: 0 - description: | - Influences the generation of new and varied concepts in the model's output + description: > + Influences the generation of new and varied concepts in the model's + output. temperature: type: number default: 0.7 min: 0 max: 1 description: | - Controls the randomness of the model's output + Controls the randomness of the model's output. top_p: type: number default: 0.95 min: 0 max: 1 description: | - Set probability threshold for more relevant outputs - + Set probability threshold for more relevant outputs. ChatCompletionResponse: type: object description: Description of the response structure @@ -123,7 +139,7 @@ components: type: string nullable: true example: null - description: Reason for finishing the response, if applicable + description: "Reason for finishing the response, if applicable" index: type: integer example: 0 @@ -133,7 +149,7 @@ components: properties: content: type: string - example: "Hello user. What can I help you with?" + example: Hello user. What can I help you with? description: Content of the message role: type: string diff --git a/docs/openapi/specs/messages.yaml b/docs/openapi/specs/messages.yaml index 3ab578f0c0..9a0799f6a1 100644 --- a/docs/openapi/specs/messages.yaml +++ b/docs/openapi/specs/messages.yaml @@ -6,34 +6,37 @@ components: id: type: string description: | - "Sequential or UUID identifier of the message." + Sequential or UUID identifier of the message. example: 0 object: type: string description: | - "Type of the object, defaults to 'thread.message'." + Type of the object, defaults to 'thread.message'. example: thread.message created_at: type: integer format: int64 description: | - "Unix timestamp representing the creation time of the message." + Unix timestamp representing the creation time of the message. thread_id: type: string - description: | - "Identifier of the thread to which this message belongs. Defaults to parent thread." - example: "thread_asdf" + description: > + Identifier of the thread to which this message belongs. Defaults to + parent thread. + example: thread_asdf assistant_id: type: string - description: | - "Identifier of the assistant involved in the message. Defaults to parent thread." + description: > + Identifier of the assistant involved in the message. Defaults to + parent thread. example: jan role: type: string - enum: ["user", "assistant"] + enum: + - user + - assistant description: | - "Role of the sender, either 'user' or 'assistant'." - + Role of the sender, either 'user' or 'assistant'. content: type: array items: @@ -42,36 +45,33 @@ components: type: type: string description: | - "Type of content, e.g., 'text'." - + Type of content, e.g., 'text'. text: type: object properties: value: type: string description: | - "Text content of the message." - example: "Hi!?" + Text content of the message. + example: Hi!? annotations: type: array items: type: string description: | - "Annotations for the text content, if any." + Annotations for the text content, if any. example: [] metadata: type: object description: | - "Metadata associated with the message, defaults to an empty object." - + Metadata associated with the message, defaults to an empty object. example: {} - GetMessageResponse: type: object properties: id: type: string - description: "The identifier of the message." + description: The identifier of the message. example: msg_abc123 object: type: string @@ -80,11 +80,11 @@ components: created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the message." + description: Unix timestamp representing the creation time of the message. example: 1699017614 thread_id: type: string - description: "Identifier of the thread to which this message belongs." + description: Identifier of the thread to which this message belongs. example: thread_abc123 role: type: string @@ -104,8 +104,8 @@ components: properties: value: type: string - description: "Text content of the message." - example: "How does AI work? Explain it in simple terms." + description: Text content of the message. + example: How does AI work? Explain it in simple terms. annotations: type: array items: @@ -128,15 +128,14 @@ components: example: null metadata: type: object - description: "Metadata associated with the message." + description: Metadata associated with the message. example: {} - CreateMessageResponse: type: object properties: id: type: string - description: "The identifier of the created message." + description: The identifier of the created message. example: msg_abc123 object: type: string @@ -145,11 +144,11 @@ components: created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the message." + description: Unix timestamp representing the creation time of the message. example: 1699017614 thread_id: type: string - description: "Identifier of the thread to which this message belongs." + description: Identifier of the thread to which this message belongs. example: thread_abc123 role: type: string @@ -169,8 +168,8 @@ components: properties: value: type: string - description: "Text content of the message." - example: "How does AI work? Explain it in simple terms." + description: Text content of the message. + example: How does AI work? Explain it in simple terms. annotations: type: array items: @@ -193,39 +192,37 @@ components: example: null metadata: type: object - description: "Metadata associated with the message." + description: Metadata associated with the message. example: {} - ListMessagesResponse: type: object properties: object: type: string description: "Type of the object, indicating it's a list." - default: "list" + default: list data: type: array items: $ref: "#/components/schemas/ListMessageObject" first_id: type: string - description: "Identifier of the first message in the list." - example: "msg_abc123" + description: Identifier of the first message in the list. + example: msg_abc123 last_id: type: string - description: "Identifier of the last message in the list." - example: "msg_abc456" + description: Identifier of the last message in the list. + example: msg_abc456 has_more: type: boolean - description: "Indicates whether there are more messages to retrieve." + description: Indicates whether there are more messages to retrieve. example: false - ListMessageObject: type: object properties: id: type: string - description: "The identifier of the message." + description: The identifier of the message. example: msg_abc123 object: type: string @@ -234,11 +231,11 @@ components: created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the message." + description: Unix timestamp representing the creation time of the message. example: 1699017614 thread_id: type: string - description: "Identifier of the thread to which this message belongs." + description: Identifier of the thread to which this message belongs. example: thread_abc123 role: type: string @@ -257,8 +254,8 @@ components: properties: value: type: string - description: "Text content of the message." - example: "How does AI work? Explain it in simple terms." + description: Text content of the message. + example: How does AI work? Explain it in simple terms. annotations: type: array items: @@ -280,37 +277,35 @@ components: example: null metadata: type: object - description: "Metadata associated with the message." + description: Metadata associated with the message. example: {} - MessageFileObject: type: object properties: id: type: string - description: "The identifier of the file." + description: The identifier of the file. example: file-abc123 object: type: string - description: "Type of the object, indicating it's a thread message file." + description: Type of the object, indicating it's a thread message file. example: thread.message.file created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the file." + description: Unix timestamp representing the creation time of the file. example: 1699061776 message_id: type: string - description: "Identifier of the message to which this file is associated." + description: Identifier of the message to which this file is associated. example: msg_abc123 - ListMessageFilesResponse: type: object properties: object: type: string - description: "Type of the object, indicating it's a list." - default: "list" + description: Type of the object, indicating it's a list. + default: list data: type: array items: diff --git a/docs/openapi/specs/models.yaml b/docs/openapi/specs/models.yaml index 1322b90ee6..374f733333 100644 --- a/docs/openapi/specs/models.yaml +++ b/docs/openapi/specs/models.yaml @@ -5,7 +5,8 @@ components: properties: object: type: string - enum: [list] + enum: + - list data: type: array items: @@ -13,68 +14,75 @@ components: required: - object - data - Model: type: object properties: type: type: string - default: "model" - description: "The type of the object." + default: model + description: The type of the object. version: type: string default: "1" - description: "The version number of the model." + description: The version number of the model. id: type: string - description: "Unique identifier used in chat-completions model_name, matches folder name." - example: "zephyr-7b" + description: >- + Unique identifier used in chat-completions model_name, matches + folder name. + example: zephyr-7b name: type: string - description: "Name of the model." - example: "Zephyr 7B" + description: Name of the model. + example: Zephyr 7B owned_by: type: string - description: "Compatibility field for OpenAI." + description: Compatibility field for OpenAI. default: "" created: type: integer format: int64 - description: "Unix timestamp representing the creation time." + description: Unix timestamp representing the creation time. description: type: string - description: "Description of the model." + description: Description of the model. state: type: string - enum: [null, "downloading", "ready", "starting", "stopping"] - description: "Current state of the model." + enum: + - null + - downloading + - ready + - starting + - stopping + description: Current state of the model. format: type: string description: "State format of the model, distinct from the engine." - example: "ggufv3" + example: ggufv3 source_url: type: string format: uri - description: "URL to the source of the model." - example: "https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/blob/main/zephyr-7b-beta.Q4_K_M.gguf" + description: URL to the source of the model. + example: >- + https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/blob/main/zephyr-7b-beta.Q4_K_M.gguf settings: type: object properties: ctx_len: type: string - description: "Context length." + description: Context length. example: "2048" ngl: type: string - description: "Number of layers." + description: Number of layers. example: "100" embedding: type: string - description: "Indicates if embedding is enabled." + description: Indicates if embedding is enabled. example: "true" n_parallel: type: string - description: "Number of parallel processes." + description: Number of parallel processes. example: "4" additionalProperties: false parameters: @@ -82,147 +90,152 @@ components: properties: temperature: type: string - description: "Temperature setting for the model." + description: Temperature setting for the model. example: "0.7" token_limit: type: string - description: "Token limit for the model." + description: Token limit for the model. example: "2048" top_k: type: string - description: "Top-k setting for the model." + description: Top-k setting for the model. example: "0" top_p: type: string - description: "Top-p setting for the model." + description: Top-p setting for the model. example: "1" stream: type: string - description: "Indicates if streaming is enabled." + description: Indicates if streaming is enabled. example: "true" additionalProperties: false metadata: type: object - description: "Additional metadata." + description: Additional metadata. assets: type: array items: type: string - description: "List of assets related to the model." + description: List of assets related to the model. required: - source_url - ModelObject: type: object properties: id: type: string description: | - "The identifier of the model." - - example: "zephyr-7b" + The identifier of the model. + example: zephyr-7b object: type: string description: | - "The type of the object, indicating it's a model." - - default: "model" + The type of the object, indicating it's a model. + default: model created: type: integer format: int64 description: | - "Unix timestamp representing the creation time of the model." - - example: "1253935178" + Unix timestamp representing the creation time of the model. + example: 1253935178 owned_by: type: string description: | - "The entity that owns the model." - - example: "_" - + The entity that owns the model. + example: _ GetModelResponse: type: object properties: id: type: string - description: "The identifier of the model." - example: "zephyr-7b" + description: The identifier of the model. + example: zephyr-7b object: type: string description: "Type of the object, indicating it's a model." - default: "model" + default: model created: type: integer format: int64 - description: "Unix timestamp representing the creation time of the model." + description: Unix timestamp representing the creation time of the model. owned_by: type: string - description: "The entity that owns the model." - example: "_" + description: The entity that owns the model. + example: _ state: type: string - enum: [not_downloaded, downloaded, running, stopped] - description: "The current state of the model." + enum: + - not_downloaded + - downloaded + - running + - stopped + description: The current state of the model. source_url: type: string format: uri - description: "URL to the source of the model." - example: "https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/blob/main/zephyr-7b-beta.Q4_K_M.gguf" + description: URL to the source of the model. + example: >- + https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/blob/main/zephyr-7b-beta.Q4_K_M.gguf engine_parameters: type: object properties: pre_prompt: type: string - description: "Predefined prompt used for setting up internal configurations." + description: Predefined prompt used for setting up internal configurations. default: "" - example: "Initial setup complete." + example: Initial setup complete. system_prompt: type: string - description: "Prefix used for system-level prompts." + description: Prefix used for system-level prompts. default: "SYSTEM: " user_prompt: type: string - description: "Prefix used for user prompts." - default: "USER: " + description: Prefix used for user prompts. + default: "USER: " ai_prompt: type: string - description: "Prefix used for assistant prompts." + description: Prefix used for assistant prompts. default: "ASSISTANT: " ngl: type: integer - description: "Number of neural network layers loaded onto the GPU for acceleration." + description: >- + Number of neural network layers loaded onto the GPU for + acceleration. minimum: 0 maximum: 100 default: 100 example: 100 ctx_len: type: integer - description: "Context length for model operations, varies based on the specific model." + description: >- + Context length for model operations, varies based on the + specific model. minimum: 128 maximum: 4096 default: 2048 example: 2048 n_parallel: type: integer - description: "Number of parallel operations, relevant when continuous batching is enabled." + description: >- + Number of parallel operations, relevant when continuous batching + is enabled. minimum: 1 maximum: 10 default: 1 example: 4 cont_batching: type: boolean - description: "Indicates if continuous batching is used for processing." + description: Indicates if continuous batching is used for processing. default: false example: false cpu_threads: type: integer - description: "Number of threads allocated for CPU-based inference." + description: Number of threads allocated for CPU-based inference. minimum: 1 example: 8 embedding: type: boolean - description: "Indicates if embedding layers are enabled in the model." + description: Indicates if embedding layers are enabled in the model. default: true example: true model_parameters: @@ -230,74 +243,84 @@ components: properties: ctx_len: type: integer - description: "Maximum context length the model can handle." + description: Maximum context length the model can handle. minimum: 0 maximum: 4096 default: 2048 example: 2048 ngl: type: integer - description: "Number of layers in the neural network." + description: Number of layers in the neural network. minimum: 1 maximum: 100 default: 100 example: 100 embedding: type: boolean - description: "Indicates if embedding layers are used." + description: Indicates if embedding layers are used. default: true example: true n_parallel: type: integer - description: "Number of parallel processes the model can run." + description: Number of parallel processes the model can run. minimum: 1 maximum: 10 default: 1 example: 4 temperature: type: number - description: "Controls randomness in model's responses. Higher values lead to more random responses." - minimum: 0.0 - maximum: 2.0 + description: >- + Controls randomness in model's responses. Higher values lead to + more random responses. + minimum: 0 + maximum: 2 default: 0.7 example: 0.7 token_limit: type: integer - description: "Maximum number of tokens the model can generate in a single response." + description: >- + Maximum number of tokens the model can generate in a single + response. minimum: 1 maximum: 4096 default: 2048 example: 2048 top_k: type: integer - description: "Limits the model to consider only the top k most likely next tokens at each step." + description: >- + Limits the model to consider only the top k most likely next + tokens at each step. minimum: 0 maximum: 100 default: 0 example: 0 top_p: type: number - description: "Nucleus sampling parameter. The model considers the smallest set of tokens whose cumulative probability exceeds the top_p value." - minimum: 0.0 - maximum: 1.0 - default: 1.0 - example: 1.0 - + description: >- + Nucleus sampling parameter. The model considers the smallest set + of tokens whose cumulative probability exceeds the top_p value. + minimum: 0 + maximum: 1 + default: 1 + example: 1 metadata: type: object properties: engine: type: string - description: "The engine used by the model." - enum: [nitro, openai, hf_inference] + description: The engine used by the model. + enum: + - nitro + - openai + - hf_inference quantization: type: string - description: "Quantization parameter of the model." - example: "Q3_K_L" + description: Quantization parameter of the model. + example: Q3_K_L size: type: string - description: "Size of the model." - example: "7B" + description: Size of the model. + example: 7B required: - id - object @@ -307,75 +330,71 @@ components: - source_url - parameters - metadata - DeleteModelResponse: type: object properties: id: type: string - description: "The identifier of the model that was deleted." - example: "model-zephyr-7B" + description: The identifier of the model that was deleted. + example: model-zephyr-7B object: type: string - description: "Type of the object, indicating it's a model." - default: "model" + description: Type of the object, indicating it's a model. + default: model deleted: type: boolean - description: "Indicates whether the model was successfully deleted." + description: Indicates whether the model was successfully deleted. example: true - StartModelResponse: type: object properties: id: type: string - description: "The identifier of the model that was started." - example: "model-zephyr-7B" + description: The identifier of the model that was started. + example: model-zephyr-7B object: type: string - description: "Type of the object, indicating it's a model." - default: "model" + description: Type of the object, indicating it's a model. + default: model state: type: string - description: "The current state of the model after the start operation." - example: "running" + description: The current state of the model after the start operation. + example: running required: - id - object - state - StopModelResponse: type: object properties: id: type: string - description: "The identifier of the model that was started." - example: "model-zephyr-7B" + description: The identifier of the model that was started. + example: model-zephyr-7B object: type: string - description: "Type of the object, indicating it's a model." - default: "model" + description: Type of the object, indicating it's a model. + default: model state: type: string - description: "The current state of the model after the start operation." - example: "stopped" + description: The current state of the model after the start operation. + example: stopped required: - id - object - state - DownloadModelResponse: type: object properties: id: type: string - description: "The identifier of the model that was started." - example: "model-zephyr-7B" + description: The identifier of the model that was started. + example: model-zephyr-7B object: type: string - description: "Type of the object, indicating it's a model." - default: "model" + description: Type of the object, indicating it's a model. + default: model state: type: string - description: "The current state of the model after the start operation." - example: "downloaded" + description: The current state of the model after the start operation. + example: downloaded diff --git a/docs/openapi/specs/threads.yaml b/docs/openapi/specs/threads.yaml index 0c3a30ce88..f432b56fff 100644 --- a/docs/openapi/specs/threads.yaml +++ b/docs/openapi/specs/threads.yaml @@ -6,118 +6,111 @@ components: id: type: string description: | - "The identifier of the thread, defaults to foldername." - + The identifier of the thread, defaults to foldername. example: thread_.... object: type: string description: | - "Type of the object, defaults to thread." - + Type of the object, defaults to thread. example: thread title: type: string - description: | - "A brief summary or description of the thread, defaults to an empty string." - - example: "funny physics joke" + description: > + A brief summary or description of the thread, defaults to an empty + string. + example: funny physics joke assistants: type: array - description: | - + description: "" items: properties: assistant_id: type: string description: | The identifier of assistant, defaults to "jan" - example: jan model: type: object properties: id: type: string - description: | - + description: "" example: ... settings: type: object - description: | - Defaults to and overrides assistant.json's "settings" (and if none, then model.json "settings") + description: > + Defaults to and overrides assistant.json's "settings" (and + if none, then model.json "settings") parameters: type: object - description: | - Defaults to and overrides assistant.json's "parameters" (and if none, then model.json "parameters") - + description: > + Defaults to and overrides assistant.json's "parameters" + (and if none, then model.json "parameters") created: type: integer format: int64 - description: | - "Unix timestamp representing the creation time of the thread, defaults to file creation time." - + description: > + Unix timestamp representing the creation time of the thread, + defaults to file creation time. example: 1231231 metadata: type: object description: | - "Metadata associated with the thread, defaults to an empty object." - + Metadata associated with the thread, defaults to an empty object. example: {} - GetThreadResponse: type: object properties: id: type: string - description: "The identifier of the thread." + description: The identifier of the thread. example: thread_abc123 object: type: string - description: "Type of the object" + description: Type of the object example: thread created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the thread." + description: Unix timestamp representing the creation time of the thread. example: 1699014083 assistants: type: array items: type: string - description: "List of assistants involved in the thread." - example: ["assistant-001"] + description: List of assistants involved in the thread. + example: + - assistant-001 metadata: type: object - description: "Metadata associated with the thread." + description: Metadata associated with the thread. example: {} messages: type: array items: type: string - description: "List of messages within the thread." + description: List of messages within the thread. example: [] - CreateThreadResponse: type: object properties: id: type: string - description: "The identifier of the newly created thread." + description: The identifier of the newly created thread. example: thread_abc123 object: type: string - description: "Type of the object, indicating it's a thread." + description: Type of the object, indicating it's a thread. example: thread created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the thread." + description: Unix timestamp representing the creation time of the thread. example: 1699014083 metadata: type: object - description: "Metadata associated with the newly created thread." + description: Metadata associated with the newly created thread. example: {} - ThreadMessageObject: type: object properties: @@ -125,20 +118,19 @@ components: type: string description: | "Role of the sender, either 'user' or 'assistant'." - - enum: ["user", "assistant"] + enum: + - user + - assistant content: type: string description: | "Text content of the message." - file_ids: type: array items: type: string description: | "Array of file IDs associated with the message, if any." - ModifyThreadResponse: type: object properties: @@ -154,19 +146,18 @@ components: created_at: type: integer format: int64 - description: "Unix timestamp representing the creation time of the thread." + description: Unix timestamp representing the creation time of the thread. example: 1699014083 metadata: type: object - description: "Metadata associated with the modified thread." + description: Metadata associated with the modified thread. example: {} - DeleteThreadResponse: type: object properties: id: type: string - description: "The identifier of the deleted thread." + description: The identifier of the deleted thread. example: thread_abc123 object: type: string @@ -174,5 +165,5 @@ components: example: thread.deleted deleted: type: boolean - description: "Indicates whether the thread was successfully deleted." + description: Indicates whether the thread was successfully deleted. example: true