Messages
caution
This is currently under development.
Overview
Messages
capture a conversation's content. This can include the content from LLM responses and other metadata from chat completions.
- Users and assistants can send multimedia messages.
- An OpenAI Message API compatible endpoint at
localhost:1337/v1/messages
.
Folder Structure
Messages are saved in the /threads/{thread_id}
folder in messages.jsonl
files
jan/
threads/
assistant_name_unix_timestamp/
thread.json # Thread metadata
messages.jsonl # Messages are stored in jsonl format
message.jsonl
Individual messages are saved in jsonl
format for indexing purposes.
{...message_2}
{...message_1}
{...message_0}
Examples
Here's a standard example message
sent from a user.
"id": "0", // Sequential or UUID
"object": "thread.message", // Defaults to "thread.message"
"created_at": 1698983503,
"thread_id": "thread_asdf", // Defaults to parent thread
"assistant_id": "jan", // Defaults to parent thread
"role": "user", // From either "user" or "assistant"
"content": [
{
"type": "text",
"text": {
"value": "Hi!?",
"annotations": []
}
}
],
"metadata": {}, // Defaults to {}
Here's an example message
response from an assistant.
"id": "0", // Sequential or UUID
"object": "thread.message", // Defaults to "thread.message"
"created_at": 1698983503,
"thread_id": "thread_asdf", // Defaults to parent thread
"assistant_id": "jan", // Defaults to parent thread
"role": "assistant", // From either "user" or "assistant"
"content": [ // Usually from Chat Completion obj
{
"type": "text",
"text": {
"value": "Hi! How can I help you today?",
"annotations": []
}
}
],
"metadata": {}, // Defaults to {}
"usage": {} // Save chat completion properties https://platform.openai.com/docs/api-reference/chat/object
API Reference
Jan's messages
API is compatible with OpenAI's Messages API, with additional methods for managing messages locally.
See Jan Messages API.