All the data over the WebSocket must be represented as JSON.
Packet types:
- PING (C/S)
- Ping
- SESSION (C/S)
- Create
- Resume
- Destroy
- CHAT (C/S)
- Request
- Response
- SYSTEM (S)
- System Message
Simple Ping/Pong
{
"msg": "ping",
"cid": "1a2b3c4d",
"content": null
}
{
"msg": "ping",
"cid": "1a2b3c4d",
"content": null
}
In order to do anything the client must first send a session start request.
{
"msg": "session",
"cid": "1a2b3c4d",
"content": {
"request": "create",
"settings": {
"model": "ggml-gpt4all-l13b-snoozy.bin",
"temperature": 0.8,
"seed": 1234
}
}
}
{
"msg": "session",
"cid": "1a2b3c4d",
"content": {
"session_id": "111111111",
"success": true,
"error": null
}
}
This will resume a session if it exists.
{
"msg": "session",
"cid": "1a2b3c4d",
"content": {
"request": "resume",
"session_id": "1234abcd"
}
}
{
"msg": "session",
"cid": "1a2b3c4d",
"content": {
"success": true,
"error": null
}
}
This can be sent at any time to show the info about a session.
Response status can be:
- initializing
- idle
- processing
{
"msg": "session",
"cid": "1a2b3c4d",
"content": {
"request": "status",
"session_id": "1234abcd"
}
}
{
"msg": "session",
"cid": "1a2b3c4d",
"content": {
"success": true,
"error": null,
"status": "idle",
"settings": {
"model": "ggml-gpt4all-l13b-snoozy.bin",
"temperature": 0.8,
"seed": 1234
}
}
}
This can only be sent to the session you are currently using.
{
"msg": "session",
"cid": "1a2b3c4d",
"content": {
"request": "destroy",
"session_id": "1234abcd"
}
}
{
"msg": "session",
"cid": "1a2b3c4d",
"content": {
"success": true,
"error": null
}
}
This is a message from the client to the server.
{
"msg": "chat",
"cid": "1a2b3c4d",
"content": {
"type": "text",
"data": "<base64 encoded message>"
}
}
{
"msg": "chat",
"cid": "1a2b3c4d",
"content": {
"success": true,
"error": false,
"sender": "Alice",
"bot": true,
"type": "text",
"data": "<base64 encoded message>"
}
}
Message from the system (not the agent).
{
"msg": "system",
"cid": "1a2b3c4d",
"content": {
"type": "text",
"data": "<base64 encoded message>"
}
}