Skip to content

Commit

Permalink
docs: label message
Browse files Browse the repository at this point in the history
  • Loading branch information
0xHieu01 committed Nov 27, 2023
1 parent 5d1b953 commit 31f1650
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 44 deletions.
96 changes: 62 additions & 34 deletions docs/openapi/jan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -505,15 +505,21 @@ paths:
tags:
- Messages
summary: List messages
description: Retrieves all messages from the given thread.
description: |
<a href = "https://platform.openai.com/docs/api-reference/messages/listMessages"> <button style = "color: #388434"> OpenAI compatible </button></a>
Retrieves all messages from the given thread.
parameters:
- in: path
name: thread_id
required: true
schema:
type: string
example: thread_abc123
description: The ID of the thread from which to retrieve messages.
description: |
The ID of the thread from which to retrieve messages.
<span style="color:#388434">OpenAI compatible</span>
responses:
"200":
description: List of messages retrieved successfully
Expand All @@ -531,15 +537,21 @@ paths:
tags:
- Messages
summary: Create message
description: Create a message
description: |
<a href = "https://platform.openai.com/docs/api-reference/messages/createMessage"> <button style = "color: #388434"> OpenAI compatible </button></a>
Create a message
parameters:
- in: path
name: thread_id
required: true
schema:
type: string
example: thread_abc123
description: The ID of the thread to which the message will be posted.
description: |
The ID of the thread to which the message will be posted.
<span style="color:#388434">OpenAI compatible</span>
requestBody:
required: true
content:
Expand All @@ -549,12 +561,18 @@ paths:
properties:
role:
type: string
description: "Role of the sender, either 'user' or 'assistant'."
description: |
"Role of the sender, either 'user' or 'assistant'."
<span style="color:#388434">OpenAI compatible</span>
example: "user"
enum: ["user", "assistant"]
content:
type: string
description: "Text content of the message."
description: |
"Text content of the message."
<span style="color:#388434">OpenAI compatible</span>
example: "How does AI work? Explain it in simple terms."
required:
- role
Expand All @@ -581,23 +599,32 @@ paths:
operationId: retrieveMessage
tags:
- Messages
summary: Retrieve Message
description: Retrieve a specific message from a thread using its thread_id and message_id.
summary: Retrieve message
description: |
<a href = "https://platform.openai.com/docs/api-reference/messages/getMessage"> <button style = "color: #388434"> OpenAI compatible </button></a>
Retrieve a specific message from a thread using its thread_id and message_id.
parameters:
- in: path
name: thread_id
required: true
schema:
type: string
example: thread_abc123
description: The ID of the thread containing the message.
description: |
The ID of the thread containing the message.
<span style="color:#388434">OpenAI compatible</span>
- in: path
name: message_id
required: true
schema:
type: string
example: msg_abc123
description: The ID of the message to retrieve.
description: |
The ID of the message to retrieve.
<span style="color:#388434">OpenAI compatible</span>
responses:
"200":
description: OK
Expand All @@ -617,35 +644,21 @@ paths:
tags:
- Messages
summary: List message files
securitySchemes:
petstore_auth:
description: |
Get access to data while protecting your account credentials.
OAuth2 is also a safer and more secure way to give you access.
type: oauth2
flows:
implicit:
authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog'
scopes:
'write:pets': modify pets in your account
'read:pets': read your pets
description: |
<a href = "https://platform.openai.com/docs/api-reference/messages/listMessages"> <button style = "color: #388434"> OpenAI compatible </button></a>
<a href = "https://platform.openai.com/docs/api-reference/messages/listMessages"> <button style = "color: #fec928"> Jan </button></a>
<a href = "https://platform.openai.com/docs/api-reference/messages/listMessageFiles"> <button style = "color: #388434"> OpenAI compatible </button></a>
Returns a list of message files.
<a href = "https://platform.openai.com/docs/api-reference/messages/listMessages"> <button style = "color: #388434">OpenAI compatible </button></a>
parameters:
- in: path
name: thread_id
required: true
schema:
type: string
example: thread_abc123
description: The ID of the thread containing the message.
description: |
The ID of the thread containing the message.
<span style="color:#388434">OpenAI compatible</span>
- in: path
name: message_id
required: true
Expand Down Expand Up @@ -675,29 +688,41 @@ paths:
tags:
- Messages
summary: Retrieve message file
description: Retrieves a file associated with a specific message in a thread.
description: |
<a href = "https://platform.openai.com/docs/api-reference/messages/getMessageFile"> <button style = "color: #388434"> OpenAI compatible </button></a>
Retrieves a file associated with a specific message in a thread.
parameters:
- in: path
name: thread_id
required: true
schema:
type: string
example: thread_abc123
description: The ID of the thread containing the message.
description: |
The ID of the thread containing the message.
<span style="color:#388434">OpenAI compatible</span>
- in: path
name: message_id
required: true
schema:
type: string
example: msg_abc123
description: The ID of the message associated with the file.
description: |
The ID of the message associated with the file.
<span style="color:#388434">OpenAI compatible</span>
- in: path
name: file_id
required: true
schema:
type: string
example: file-abc123
description: The ID of the file to retrieve.
description: |
The ID of the file to retrieve.
<span style="color:#388434">OpenAI compatible</span>
responses:
"200":
description: File retrieved successfully
Expand Down Expand Up @@ -733,7 +758,10 @@ x-webhooks:
MessageObject:
post:
summary: The message object
description: Information about a message in the thread
description: |
<a href = "https://platform.openai.com/docs/api-reference/messages/object"> <button style = "color: #388434"> OpenAI compatible </button></a>
Information about a message in the thread
operationId: MessageObject
tags:
- Messages
Expand Down
50 changes: 40 additions & 10 deletions docs/openapi/specs/messages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,82 @@ components:
properties:
id:
type: string
description: "Sequential or UUID identifier of the message."
description: |
"Sequential or UUID identifier of the message."
<span style="color:#388434">OpenAI compatible</span>
example: 0
object:
type: string
description: "Type of the object, defaults to 'thread.message'."
description: |
"Type of the object, defaults to 'thread.message'."
<span style="color:#388434">OpenAI compatible</span>
example: thread.message
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."
<span style="color:#388434">OpenAI compatible</span>
thread_id:
type: string
description: "Identifier of the thread to which this message belongs. Defaults to parent thread."
description: |
"Identifier of the thread to which this message belongs. Defaults to parent thread."
<span style="color:#388434">OpenAI compatible</span>
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."
<span style="color:#388434">OpenAI compatible</span>
example: jan
role:
type: string
enum: ["user", "assistant"]
description: "Role of the sender, either 'user' or 'assistant'."
description: |
"Role of the sender, either 'user' or 'assistant'."
<span style="color:#388434">OpenAI compatible</span>
content:
type: array
items:
type: object
properties:
type:
type: string
description: "Type of content, e.g., 'text'."
description: |
"Type of content, e.g., 'text'."
<span style="color:#388434">OpenAI compatible</span>
text:
type: object
properties:
value:
type: string
description: "Text content of the message."
description: |
"Text content of the message."
<span style="color:#388434">OpenAI compatible</span>
example: "Hi!?"
annotations:
type: array
items:
type: string
description: "Annotations for the text content, if any."
description: |
"Annotations for the text content, if any."
<span style="color:#388434">OpenAI compatible</span>
example: []
metadata:
type: object
description: "Metadata associated with the message, defaults to an empty object."
description: |
"Metadata associated with the message, defaults to an empty object."
<span style="color:#388434">OpenAI compatible</span>
example: {}

GetMessageResponse:
Expand Down

0 comments on commit 31f1650

Please sign in to comment.