chore: add api docs to electron (#2488)
This commit is contained in:
parent
0ff22e407a
commit
50f819fdd7
@ -44,7 +44,7 @@ COPY --from=builder /app/web ./web/
|
||||
COPY --from=builder /app/models ./models/
|
||||
|
||||
RUN yarn workspace @janhq/uikit install && yarn workspace @janhq/uikit build
|
||||
RUN yarn workspace jan-web install
|
||||
RUN yarn workspace @janhq/web install
|
||||
|
||||
RUN npm install -g serve@latest
|
||||
|
||||
@ -55,7 +55,7 @@ ENV JAN_API_PORT 1337
|
||||
|
||||
ENV API_BASE_URL http://localhost:1337
|
||||
|
||||
CMD ["sh", "-c", "export NODE_ENV=production && yarn workspace jan-web build && cd web && npx serve out & cd server && node build/main.js"]
|
||||
CMD ["sh", "-c", "export NODE_ENV=production && yarn workspace @janhq/web build && cd web && npx serve out & cd server && node build/main.js"]
|
||||
|
||||
# docker build -t jan .
|
||||
# docker run -p 1337:1337 -p 3000:3000 -p 3928:3928 jan
|
||||
|
||||
@ -68,7 +68,7 @@ COPY --from=builder /app/web ./web/
|
||||
COPY --from=builder /app/models ./models/
|
||||
|
||||
RUN yarn workspace @janhq/uikit install && yarn workspace @janhq/uikit build
|
||||
RUN yarn workspace jan-web install
|
||||
RUN yarn workspace @janhq/web install
|
||||
|
||||
RUN npm install -g serve@latest
|
||||
|
||||
@ -81,7 +81,7 @@ ENV JAN_API_PORT 1337
|
||||
|
||||
ENV API_BASE_URL http://localhost:1337
|
||||
|
||||
CMD ["sh", "-c", "export NODE_ENV=production && yarn workspace jan-web build && cd web && npx serve out & cd server && node build/main.js"]
|
||||
CMD ["sh", "-c", "export NODE_ENV=production && yarn workspace @janhq/web build && cd web && npx serve out & cd server && node build/main.js"]
|
||||
|
||||
# pre-requisites: nvidia-docker
|
||||
# docker build -t jan-gpu . -f Dockerfile.gpu
|
||||
|
||||
@ -150,7 +150,7 @@ common:
|
||||
command: ['/bin/sh', '-c']
|
||||
args:
|
||||
[
|
||||
'export NODE_ENV=production && yarn workspace jan-web build && cd web && npx serve out',
|
||||
'export NODE_ENV=production && yarn workspace @janhq/web build && cd web && npx serve out',
|
||||
]
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
0
docs/openapi/.gitkeep
Normal file
0
docs/openapi/.gitkeep
Normal file
2397
docs/openapi/jan.json
Normal file
2397
docs/openapi/jan.json
Normal file
File diff suppressed because it is too large
Load Diff
1043
docs/openapi/jan.yaml
Normal file
1043
docs/openapi/jan.yaml
Normal file
File diff suppressed because it is too large
Load Diff
319
docs/openapi/specs/assistants.yaml
Normal file
319
docs/openapi/specs/assistants.yaml
Normal file
@ -0,0 +1,319 @@
|
||||
---
|
||||
components:
|
||||
schemas:
|
||||
AssistantObject:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the assistant.
|
||||
example: asst_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating it's an assistant.
|
||||
default: assistant
|
||||
version:
|
||||
type: integer
|
||||
description: Version number of the assistant.
|
||||
example: 1
|
||||
created_at:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Unix timestamp representing the creation time of the assistant.
|
||||
example: 1698984975
|
||||
name:
|
||||
type: string
|
||||
description: Name of the assistant.
|
||||
example: Math Tutor
|
||||
description:
|
||||
type: string
|
||||
description: Description of the assistant. Can be null.
|
||||
example: null
|
||||
avatar:
|
||||
type: string
|
||||
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.
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
model_id:
|
||||
type: string
|
||||
example: model_0
|
||||
instructions:
|
||||
type: string
|
||||
description: A system prompt for the assistant.
|
||||
example: Be concise
|
||||
events:
|
||||
type: object
|
||||
description: Event subscription settings for the assistant.
|
||||
properties:
|
||||
in:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
out:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
description: Metadata associated with the assistant.
|
||||
ListAssistantsResponse: null
|
||||
CreateAssistantResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the assistant.
|
||||
example: asst_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating it's an assistant.
|
||||
default: assistant
|
||||
version:
|
||||
type: integer
|
||||
description: Version number of the assistant.
|
||||
example: 1
|
||||
created_at:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Unix timestamp representing the creation time of the assistant.
|
||||
example: 1698984975
|
||||
name:
|
||||
type: string
|
||||
description: Name of the assistant.
|
||||
example: Math Tutor
|
||||
description:
|
||||
type: string
|
||||
description: Description of the assistant. Can be null.
|
||||
example: null
|
||||
avatar:
|
||||
type: string
|
||||
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.
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
model_id:
|
||||
type: string
|
||||
example: model_0
|
||||
instructions:
|
||||
type: string
|
||||
description: A system prompt for the assistant.
|
||||
example: Be concise
|
||||
events:
|
||||
type: object
|
||||
description: Event subscription settings for the assistant.
|
||||
properties:
|
||||
in:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
out:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
description: Metadata associated with the assistant.
|
||||
RetrieveAssistantResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the assistant.
|
||||
example: asst_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating it's an assistant.
|
||||
default: assistant
|
||||
version:
|
||||
type: integer
|
||||
description: Version number of the assistant.
|
||||
example: 1
|
||||
created_at:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Unix timestamp representing the creation time of the assistant.
|
||||
example: 1698984975
|
||||
name:
|
||||
type: string
|
||||
description: Name of the assistant.
|
||||
example: Math Tutor
|
||||
description:
|
||||
type: string
|
||||
description: Description of the assistant. Can be null.
|
||||
example: null
|
||||
avatar:
|
||||
type: string
|
||||
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.
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
model_id:
|
||||
type: string
|
||||
example: model_0
|
||||
instructions:
|
||||
type: string
|
||||
description: A system prompt for the assistant.
|
||||
example: Be concise
|
||||
events:
|
||||
type: object
|
||||
description: Event subscription settings for the assistant.
|
||||
properties:
|
||||
in:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
out:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
description: Metadata associated with the assistant.
|
||||
ModifyAssistantObject:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the assistant.
|
||||
example: asst_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating it's an assistant.
|
||||
default: assistant
|
||||
version:
|
||||
type: integer
|
||||
description: Version number of the assistant.
|
||||
example: 1
|
||||
created_at:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Unix timestamp representing the creation time of the assistant.
|
||||
example: 1698984975
|
||||
name:
|
||||
type: string
|
||||
description: Name of the assistant.
|
||||
example: Math Tutor
|
||||
description:
|
||||
type: string
|
||||
description: Description of the assistant. Can be null.
|
||||
example: null
|
||||
avatar:
|
||||
type: string
|
||||
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.
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
model_id:
|
||||
type: string
|
||||
example: model_0
|
||||
instructions:
|
||||
type: string
|
||||
description: A system prompt for the assistant.
|
||||
example: Be concise
|
||||
events:
|
||||
type: object
|
||||
description: Event subscription settings for the assistant.
|
||||
properties:
|
||||
in:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
out:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
description: Metadata associated with the assistant.
|
||||
ModifyAssistantResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the assistant.
|
||||
example: asst_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating it's an assistant.
|
||||
default: assistant
|
||||
version:
|
||||
type: integer
|
||||
description: Version number of the assistant.
|
||||
example: 1
|
||||
created_at:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Unix timestamp representing the creation time of the assistant.
|
||||
example: 1698984975
|
||||
name:
|
||||
type: string
|
||||
description: Name of the assistant.
|
||||
example: Physics Tutor
|
||||
description:
|
||||
type: string
|
||||
description: Description of the assistant. Can be null.
|
||||
example: null
|
||||
avatar:
|
||||
type: string
|
||||
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.
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
model_id:
|
||||
type: string
|
||||
example: model_0
|
||||
instructions:
|
||||
type: string
|
||||
description: A system prompt for the assistant.
|
||||
example: Be concise!
|
||||
events:
|
||||
type: object
|
||||
description: Event subscription settings for the assistant.
|
||||
properties:
|
||||
in:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
out:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
description: Metadata associated with the assistant.
|
||||
DeleteAssistantResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the deleted assistant.
|
||||
example: asst_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating the assistant has been deleted.
|
||||
example: assistant.deleted
|
||||
deleted:
|
||||
type: boolean
|
||||
description: Indicates whether the assistant was successfully deleted.
|
||||
example: true
|
||||
196
docs/openapi/specs/chat.yaml
Normal file
196
docs/openapi/specs/chat.yaml
Normal file
@ -0,0 +1,196 @@
|
||||
---
|
||||
components:
|
||||
schemas:
|
||||
ChatObject:
|
||||
type: object
|
||||
properties:
|
||||
messages:
|
||||
type: arrays
|
||||
description: |
|
||||
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
|
||||
stream:
|
||||
type: boolean
|
||||
default: true
|
||||
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.
|
||||
max_tokens:
|
||||
type: number
|
||||
default: 2048
|
||||
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/
|
||||
frequency_penalty:
|
||||
type: number
|
||||
default: 0
|
||||
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.
|
||||
temperature:
|
||||
type: number
|
||||
default: 0.7
|
||||
min: 0
|
||||
max: 1
|
||||
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.
|
||||
cache_prompt:
|
||||
type: boolean
|
||||
default: true
|
||||
description: Optimize performance in repeated or similar requests.
|
||||
ChatCompletionRequest:
|
||||
type: object
|
||||
properties:
|
||||
messages:
|
||||
type: arrays
|
||||
description: |
|
||||
Contains input data or prompts for the model to process.
|
||||
example:
|
||||
- content: You are a helpful assistant.
|
||||
role: system
|
||||
- content: Hello!
|
||||
role: user
|
||||
model:
|
||||
type: string
|
||||
example: tinyllama-1.1b
|
||||
description: |
|
||||
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.
|
||||
max_tokens:
|
||||
type: number
|
||||
default: 2048
|
||||
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.
|
||||
frequency_penalty:
|
||||
type: number
|
||||
default: 0
|
||||
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.
|
||||
temperature:
|
||||
type: number
|
||||
default: 0.7
|
||||
min: 0
|
||||
max: 1
|
||||
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.
|
||||
ChatCompletionResponse:
|
||||
type: object
|
||||
description: Description of the response structure
|
||||
properties:
|
||||
choices:
|
||||
type: array
|
||||
description: Array of choice objects
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
finish_reason:
|
||||
type: string
|
||||
nullable: true
|
||||
example: null
|
||||
description: Reason for finishing the response, if applicable
|
||||
index:
|
||||
type: integer
|
||||
example: 0
|
||||
description: Index of the choice
|
||||
message:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: string
|
||||
example: Hello user. What can I help you with?
|
||||
description: Content of the message
|
||||
role:
|
||||
type: string
|
||||
example: assistant
|
||||
description: Role of the sender
|
||||
created:
|
||||
type: integer
|
||||
example: 1700193928
|
||||
description: Timestamp of when the response was created
|
||||
id:
|
||||
type: string
|
||||
example: ebwd2niJvJB1Q2Whyvkz
|
||||
description: Unique identifier of the response
|
||||
model:
|
||||
type: string
|
||||
nullable: true
|
||||
example: _
|
||||
description: Model used for generating the response
|
||||
object:
|
||||
type: string
|
||||
example: chat.completion
|
||||
description: Type of the response object
|
||||
system_fingerprint:
|
||||
type: string
|
||||
nullable: true
|
||||
example: _
|
||||
description: System fingerprint
|
||||
usage:
|
||||
type: object
|
||||
description: Information about the usage of tokens
|
||||
properties:
|
||||
completion_tokens:
|
||||
type: integer
|
||||
example: 500
|
||||
description: Number of tokens used for completion
|
||||
prompt_tokens:
|
||||
type: integer
|
||||
example: 33
|
||||
description: Number of tokens used in the prompt
|
||||
total_tokens:
|
||||
type: integer
|
||||
example: 533
|
||||
description: Total number of tokens used
|
||||
313
docs/openapi/specs/messages.yaml
Normal file
313
docs/openapi/specs/messages.yaml
Normal file
@ -0,0 +1,313 @@
|
||||
---
|
||||
components:
|
||||
schemas:
|
||||
MessageObject:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: |
|
||||
Sequential or UUID identifier of the message.
|
||||
example: 0
|
||||
object:
|
||||
type: string
|
||||
description: |
|
||||
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.
|
||||
thread_id:
|
||||
type: string
|
||||
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.
|
||||
example: jan
|
||||
role:
|
||||
type: string
|
||||
enum:
|
||||
- user
|
||||
- assistant
|
||||
description: |
|
||||
Role of the sender, either 'user' or 'assistant'.
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
description: |
|
||||
Type of content, e.g., 'text'.
|
||||
text:
|
||||
type: object
|
||||
properties:
|
||||
value:
|
||||
type: string
|
||||
description: |
|
||||
Text content of the message.
|
||||
example: Hi!?
|
||||
annotations:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: |
|
||||
Annotations for the text content, if any.
|
||||
example: []
|
||||
metadata:
|
||||
type: object
|
||||
description: |
|
||||
Metadata associated with the message, defaults to an empty object.
|
||||
example: {}
|
||||
GetMessageResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the message.
|
||||
example: msg_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating it's a thread message.
|
||||
default: thread.message
|
||||
created_at:
|
||||
type: integer
|
||||
format: int64
|
||||
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.
|
||||
example: thread_abc123
|
||||
role:
|
||||
type: string
|
||||
description: Role of the sender, either 'user' or 'assistant'.
|
||||
example: user
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
description: Type of content, e.g., 'text'.
|
||||
example: text
|
||||
text:
|
||||
type: object
|
||||
properties:
|
||||
value:
|
||||
type: string
|
||||
description: Text content of the message.
|
||||
example: How does AI work? Explain it in simple terms.
|
||||
annotations:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Annotations for the text content, if any.
|
||||
example: []
|
||||
file_ids:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Array of file IDs associated with the message, if any.
|
||||
example: []
|
||||
assistant_id:
|
||||
type: string
|
||||
description: Identifier of the assistant involved in the message, if applicable.
|
||||
example: null
|
||||
run_id:
|
||||
type: string
|
||||
description: Run ID associated with the message, if applicable.
|
||||
example: null
|
||||
metadata:
|
||||
type: object
|
||||
description: Metadata associated with the message.
|
||||
example: {}
|
||||
CreateMessageResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the created message.
|
||||
example: msg_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating it's a thread message.
|
||||
example: thread.message
|
||||
created_at:
|
||||
type: integer
|
||||
format: int64
|
||||
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.
|
||||
example: thread_abc123
|
||||
role:
|
||||
type: string
|
||||
description: Role of the sender, either 'user' or 'assistant'.
|
||||
example: user
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
description: Type of content, e.g., 'text'.
|
||||
example: text
|
||||
text:
|
||||
type: object
|
||||
properties:
|
||||
value:
|
||||
type: string
|
||||
description: Text content of the message.
|
||||
example: How does AI work? Explain it in simple terms.
|
||||
annotations:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Annotations for the text content, if any.
|
||||
example: []
|
||||
file_ids:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Array of file IDs associated with the message, if any.
|
||||
example: []
|
||||
assistant_id:
|
||||
type: string
|
||||
description: Identifier of the assistant involved in the message, if applicable.
|
||||
example: null
|
||||
run_id:
|
||||
type: string
|
||||
description: Run ID associated with the message, if applicable.
|
||||
example: null
|
||||
metadata:
|
||||
type: object
|
||||
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
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ListMessageObject'
|
||||
first_id:
|
||||
type: string
|
||||
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
|
||||
has_more:
|
||||
type: boolean
|
||||
description: Indicates whether there are more messages to retrieve.
|
||||
example: false
|
||||
ListMessageObject:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the message.
|
||||
example: msg_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating it's a thread message.
|
||||
example: thread.message
|
||||
created_at:
|
||||
type: integer
|
||||
format: int64
|
||||
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.
|
||||
example: thread_abc123
|
||||
role:
|
||||
type: string
|
||||
description: Role of the sender, either 'user' or 'assistant'.
|
||||
example: user
|
||||
content:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
description: Type of content, e.g., 'text'.
|
||||
text:
|
||||
type: object
|
||||
properties:
|
||||
value:
|
||||
type: string
|
||||
description: Text content of the message.
|
||||
example: How does AI work? Explain it in simple terms.
|
||||
annotations:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Annotations for the text content, if any.
|
||||
file_ids:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Array of file IDs associated with the message, if any.
|
||||
example: []
|
||||
assistant_id:
|
||||
type: string
|
||||
description: Identifier of the assistant involved in the message, if applicable.
|
||||
example: null
|
||||
run_id:
|
||||
type: string
|
||||
description: Run ID associated with the message, if applicable.
|
||||
example: null
|
||||
metadata:
|
||||
type: object
|
||||
description: Metadata associated with the message.
|
||||
example: {}
|
||||
MessageFileObject:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the file.
|
||||
example: file-abc123
|
||||
object:
|
||||
type: string
|
||||
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.
|
||||
example: 1699061776
|
||||
message_id:
|
||||
type: string
|
||||
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
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/MessageFileObject'
|
||||
259
docs/openapi/specs/models.yaml
Normal file
259
docs/openapi/specs/models.yaml
Normal file
@ -0,0 +1,259 @@
|
||||
---
|
||||
components:
|
||||
schemas:
|
||||
ListModelsResponse:
|
||||
type: object
|
||||
properties:
|
||||
object:
|
||||
type: string
|
||||
enum:
|
||||
- list
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Model'
|
||||
required:
|
||||
- object
|
||||
- data
|
||||
Model:
|
||||
type: object
|
||||
properties:
|
||||
source_url:
|
||||
type: string
|
||||
format: uri
|
||||
description: URL to the source of the model.
|
||||
example: https://huggingface.co/janhq/trinity-v1.2-GGUF/resolve/main/trinity-v1.2.Q4_K_M.gguf
|
||||
id:
|
||||
type: string
|
||||
description:
|
||||
Unique identifier used in chat-completions model_name, matches
|
||||
folder name.
|
||||
example: trinity-v1.2-7b
|
||||
object:
|
||||
type: string
|
||||
example: model
|
||||
name:
|
||||
type: string
|
||||
description: Name of the model.
|
||||
example: Trinity-v1.2 7B Q4
|
||||
version:
|
||||
type: string
|
||||
default: '1.0'
|
||||
description: The version number of the model.
|
||||
description:
|
||||
type: string
|
||||
description: Description of the model.
|
||||
example:
|
||||
Trinity is an experimental model merge using the Slerp method.
|
||||
Recommended for daily assistance purposes.
|
||||
format:
|
||||
type: string
|
||||
description: State format of the model, distinct from the engine.
|
||||
example: gguf
|
||||
settings:
|
||||
type: object
|
||||
properties:
|
||||
ctx_len:
|
||||
type: integer
|
||||
description: Context length.
|
||||
example: 4096
|
||||
prompt_template:
|
||||
type: string
|
||||
example: "<|im_start|>system\n{system_message}<|im_end|>\n<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant"
|
||||
additionalProperties: false
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
temperature:
|
||||
example: 0.7
|
||||
top_p:
|
||||
example: 0.95
|
||||
stream:
|
||||
example: true
|
||||
max_tokens:
|
||||
example: 4096
|
||||
stop:
|
||||
example: []
|
||||
frequency_penalty:
|
||||
example: 0
|
||||
presence_penalty:
|
||||
example: 0
|
||||
additionalProperties: false
|
||||
metadata:
|
||||
author:
|
||||
type: string
|
||||
example: Jan
|
||||
tags:
|
||||
example:
|
||||
- 7B
|
||||
- Merged
|
||||
- Featured
|
||||
size:
|
||||
example: 4370000000,
|
||||
cover:
|
||||
example: https://raw.githubusercontent.com/janhq/jan/main/models/trinity-v1.2-7b/cover.png
|
||||
engine:
|
||||
example: nitro
|
||||
ModelObject:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: |
|
||||
The identifier of the model.
|
||||
example: trinity-v1.2-7b
|
||||
object:
|
||||
type: string
|
||||
description: |
|
||||
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
|
||||
owned_by:
|
||||
type: string
|
||||
description: |
|
||||
The entity that owns the model.
|
||||
example: _
|
||||
GetModelResponse:
|
||||
type: object
|
||||
properties:
|
||||
source_url:
|
||||
type: string
|
||||
format: uri
|
||||
description: URL to the source of the model.
|
||||
example: https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q4_K_M.gguf
|
||||
id:
|
||||
type: string
|
||||
description:
|
||||
Unique identifier used in chat-completions model_name, matches
|
||||
folder name.
|
||||
example: mistral-ins-7b-q4
|
||||
object:
|
||||
type: string
|
||||
example: model
|
||||
name:
|
||||
type: string
|
||||
description: Name of the model.
|
||||
example: Mistral Instruct 7B Q4
|
||||
version:
|
||||
type: string
|
||||
default: '1.0'
|
||||
description: The version number of the model.
|
||||
description:
|
||||
type: string
|
||||
description: Description of the model.
|
||||
example:
|
||||
Trinity is an experimental model merge using the Slerp method.
|
||||
Recommended for daily assistance purposes.
|
||||
format:
|
||||
type: string
|
||||
description: State format of the model, distinct from the engine.
|
||||
example: gguf
|
||||
settings:
|
||||
type: object
|
||||
properties:
|
||||
ctx_len:
|
||||
type: integer
|
||||
description: Context length.
|
||||
example: 4096
|
||||
prompt_template:
|
||||
type: string
|
||||
example: '[INST] {prompt} [/INST]'
|
||||
additionalProperties: false
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
temperature:
|
||||
example: 0.7
|
||||
top_p:
|
||||
example: 0.95
|
||||
stream:
|
||||
example: true
|
||||
max_tokens:
|
||||
example: 4096
|
||||
stop:
|
||||
example: []
|
||||
frequency_penalty:
|
||||
example: 0
|
||||
presence_penalty:
|
||||
example: 0
|
||||
additionalProperties: false
|
||||
metadata:
|
||||
author:
|
||||
type: string
|
||||
example: MistralAI
|
||||
tags:
|
||||
example:
|
||||
- 7B
|
||||
- Featured
|
||||
- Foundation Model
|
||||
size:
|
||||
example: 4370000000,
|
||||
cover:
|
||||
example: https://raw.githubusercontent.com/janhq/jan/main/models/mistral-ins-7b-q4/cover.png
|
||||
engine:
|
||||
example: nitro
|
||||
DeleteModelResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the model that was deleted.
|
||||
example: mistral-ins-7b-q4
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating it's a model.
|
||||
default: model
|
||||
deleted:
|
||||
type: boolean
|
||||
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
|
||||
object:
|
||||
type: string
|
||||
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
|
||||
required:
|
||||
- id
|
||||
- object
|
||||
- state
|
||||
StopModelResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
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
|
||||
state:
|
||||
type: string
|
||||
description: The current state of the model after the start operation.
|
||||
example: stopped
|
||||
required:
|
||||
- id
|
||||
- object
|
||||
- state
|
||||
DownloadModelResponse:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
description: Message indicates Jan starting download corresponding model.
|
||||
example: Starting download mistral-ins-7b-q4
|
||||
227
docs/openapi/specs/threads.yaml
Normal file
227
docs/openapi/specs/threads.yaml
Normal file
@ -0,0 +1,227 @@
|
||||
---
|
||||
components:
|
||||
schemas:
|
||||
ThreadObject:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: |
|
||||
The identifier of the thread, defaults to foldername.
|
||||
example: thread_....
|
||||
object:
|
||||
type: string
|
||||
description: |
|
||||
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
|
||||
assistants:
|
||||
type: array
|
||||
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: ''
|
||||
example: ...
|
||||
settings:
|
||||
type: object
|
||||
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")
|
||||
created:
|
||||
type: integer
|
||||
format: int64
|
||||
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.
|
||||
example: {}
|
||||
GetThreadResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the thread.
|
||||
example: thread_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object
|
||||
example: thread
|
||||
created_at:
|
||||
type: integer
|
||||
format: int64
|
||||
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
|
||||
metadata:
|
||||
type: object
|
||||
description: Metadata associated with the thread.
|
||||
example: {}
|
||||
messages:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: List of messages within the thread.
|
||||
example: []
|
||||
CreateThreadResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the newly created thread.
|
||||
example: thread_abc123
|
||||
object:
|
||||
type: string
|
||||
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.
|
||||
example: 1699014083
|
||||
metadata:
|
||||
type: object
|
||||
description: Metadata associated with the newly created thread.
|
||||
example: {}
|
||||
CreateThreadObject:
|
||||
type: object
|
||||
properties:
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating it's a thread.
|
||||
example: thread
|
||||
title:
|
||||
type: string
|
||||
description: >
|
||||
A brief summary or description of the thread, defaults to an empty
|
||||
string.
|
||||
example: funny physics joke
|
||||
assistants:
|
||||
type: array
|
||||
description: assistant involved in the thread
|
||||
items:
|
||||
properties:
|
||||
assistant_id:
|
||||
type: string
|
||||
description: |
|
||||
The identifier of assistant, defaults to "jan"
|
||||
example: jan
|
||||
assistant_name:
|
||||
type: string
|
||||
description: |
|
||||
The name of assistant, defaults to "Jan"
|
||||
example: Jan
|
||||
instructions:
|
||||
type: string
|
||||
description: >
|
||||
The instruction of assistant, defaults to "Be my grammar corrector"
|
||||
model:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Model id
|
||||
example: mistral-ins-7b-q4
|
||||
settings:
|
||||
type: object
|
||||
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")
|
||||
engine:
|
||||
type: string
|
||||
description: Engine id
|
||||
example: nitro
|
||||
metadata:
|
||||
type: object
|
||||
description: |
|
||||
Metadata associated with the thread, defaults to an empty object.
|
||||
ThreadMessageObject:
|
||||
type: object
|
||||
properties:
|
||||
role:
|
||||
type: string
|
||||
description: |
|
||||
"Role of the sender, either 'user' or '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:
|
||||
id:
|
||||
type: string
|
||||
description: |
|
||||
"The identifier of the modified thread."
|
||||
example: thread_abc123
|
||||
object:
|
||||
type: string
|
||||
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.
|
||||
example: 1699014083
|
||||
metadata:
|
||||
type: object
|
||||
description: Metadata associated with the modified thread.
|
||||
example: {}
|
||||
DeleteThreadResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The identifier of the deleted thread.
|
||||
example: thread_abc123
|
||||
object:
|
||||
type: string
|
||||
description: Type of the object, indicating the thread has been deleted.
|
||||
example: thread.deleted
|
||||
deleted:
|
||||
type: boolean
|
||||
description: Indicates whether the thread was successfully deleted.
|
||||
example: true
|
||||
Loading…
x
Reference in New Issue
Block a user