docs: update openapi.json to v0.3.0 (#558)

dedup-snippet-at-index
Meng Zhang 2023-10-14 01:31:32 -07:00 committed by GitHub
parent 7ae1a97d57
commit b3c119d6f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 189 additions and 11 deletions

View File

@ -57,6 +57,29 @@
font-weight: 600; font-weight: 600;
} }
.get a {
display: flex;
}
.get a::after {
content: "get";
margin-left: auto;
display: inline-block;
position: relative;
top: 1px;
margin-right: -6px;
padding: 3px 6px;
border: 1px solid var(--ifm-color-success);
border-radius: 3px;
color: white;
background: var(--ifm-color-success);
text-transform: uppercase;
font-size: 10px;
line-height: 10px;
height: 10px;
font-weight: 600;
}
.Playground .monaco-editor { .Playground .monaco-editor {
padding-top: 15px; padding-top: 15px;
} }

View File

@ -2,21 +2,17 @@
"openapi": "3.0.3", "openapi": "3.0.3",
"info": { "info": {
"title": "Tabby Server", "title": "Tabby Server",
"description": "\n[![tabby stars](https://img.shields.io/github/stars/TabbyML/tabby?style=social)](https://github.com/TabbyML/tabby)\n\nOpenAPI documentation for [tabby](https://github.com/TabbyML/tabby), a self-hosted AI coding assistant.", "description": "\n[![tabby stars](https://img.shields.io/github/stars/TabbyML/tabby)](https://github.com/TabbyML/tabby)\n[![Join Slack](https://shields.io/badge/Tabby-Join%20Slack-red?logo=slack)](https://join.slack.com/t/tabbycommunity/shared_invite/zt-1xeiddizp-bciR2RtFTaJ37RBxr8VxpA)\n\nInstall following IDE / Editor extensions to get started with [Tabby](https://github.com/TabbyML/tabby).\n* [VSCode Extension](https://github.com/TabbyML/tabby/tree/main/clients/vscode) Install from the [marketplace](https://marketplace.visualstudio.com/items?itemName=TabbyML.vscode-tabby), or [open-vsx.org](https://open-vsx.org/extension/TabbyML/vscode-tabby)\n* [VIM Extension](https://github.com/TabbyML/tabby/tree/main/clients/vim)\n* [IntelliJ Platform Plugin](https://github.com/TabbyML/tabby/tree/main/clients/intellij) Install from the [marketplace](https://plugins.jetbrains.com/plugin/22379-tabby)\n",
"license": { "license": {
"name": "Apache 2.0", "name": "Apache 2.0",
"url": "https://github.com/TabbyML/tabby/blob/main/LICENSE" "url": "https://github.com/TabbyML/tabby/blob/main/LICENSE"
}, },
"version": "0.1.0" "version": "0.3.0"
}, },
"servers": [ "servers": [
{ {
"url": "https://playground.app.tabbyml.com", "url": "https://playground.app.tabbyml.com",
"description": "Playground server" "description": "Playground server"
},
{
"url": "http://localhost:8080",
"description": "Local server"
} }
], ],
"paths": { "paths": {
@ -80,7 +76,7 @@
} }
}, },
"/v1/health": { "/v1/health": {
"post": { "get": {
"tags": [ "tags": [
"v1" "v1"
], ],
@ -102,6 +98,47 @@
}, },
"components": { "components": {
"schemas": { "schemas": {
"ChatCompletionChunk": {
"type": "object",
"required": [
"content"
],
"properties": {
"content": {
"type": "string"
}
}
},
"ChatCompletionRequest": {
"type": "object",
"required": [
"messages"
],
"properties": {
"messages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Message"
}
}
},
"example": {
"messages": [
{
"content": "What is tail recursion?",
"role": "user"
},
{
"content": "It's a kind of optimization in compiler?",
"role": "assistant"
},
{
"content": "Could you share more details?",
"role": "user"
}
]
}
},
"Choice": { "Choice": {
"type": "object", "type": "object",
"required": [ "required": [
@ -124,6 +161,7 @@
"properties": { "properties": {
"prompt": { "prompt": {
"type": "string", "type": "string",
"deprecated": true,
"example": "def fib(n):", "example": "def fib(n):",
"nullable": true "nullable": true
}, },
@ -143,6 +181,7 @@
}, },
"user": { "user": {
"type": "string", "type": "string",
"description": "A unique identifier representing your end-user, which can help Tabby to monitor & generating\nreports.",
"nullable": true "nullable": true
} }
}, },
@ -170,6 +209,15 @@
"$ref": "#/components/schemas/Choice" "$ref": "#/components/schemas/Choice"
} }
} }
},
"example": {
"choices": [
{
"index": 0,
"text": "string"
}
],
"id": "string"
} }
}, },
"HealthState": { "HealthState": {
@ -177,7 +225,6 @@
"required": [ "required": [
"model", "model",
"device", "device",
"compute_type",
"arch", "arch",
"cpu_info", "cpu_info",
"cpu_count", "cpu_count",
@ -188,10 +235,11 @@
"model": { "model": {
"type": "string" "type": "string"
}, },
"device": { "chat_model": {
"type": "string" "type": "string",
"nullable": true
}, },
"compute_type": { "device": {
"type": "string" "type": "string"
}, },
"arch": { "arch": {
@ -215,6 +263,59 @@
} }
} }
}, },
"Hit": {
"type": "object",
"required": [
"score",
"doc",
"id"
],
"properties": {
"score": {
"type": "number",
"format": "float"
},
"doc": {
"$ref": "#/components/schemas/HitDocument"
},
"id": {
"type": "integer",
"format": "int32",
"minimum": 0
}
}
},
"HitDocument": {
"type": "object",
"required": [
"body",
"filepath",
"git_url",
"kind",
"language",
"name"
],
"properties": {
"body": {
"type": "string"
},
"filepath": {
"type": "string"
},
"git_url": {
"type": "string"
},
"kind": {
"type": "string"
},
"language": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"LogEventRequest": { "LogEventRequest": {
"type": "object", "type": "object",
"required": [ "required": [
@ -238,6 +339,40 @@
} }
} }
}, },
"Message": {
"type": "object",
"required": [
"role",
"content"
],
"properties": {
"role": {
"type": "string"
},
"content": {
"type": "string"
}
}
},
"SearchResponse": {
"type": "object",
"required": [
"num_hits",
"hits"
],
"properties": {
"num_hits": {
"type": "integer",
"minimum": 0
},
"hits": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Hit"
}
}
}
},
"Segments": { "Segments": {
"type": "object", "type": "object",
"required": [ "required": [
@ -255,6 +390,26 @@
} }
} }
}, },
"Snippet": {
"type": "object",
"required": [
"filepath",
"body",
"score"
],
"properties": {
"filepath": {
"type": "string"
},
"body": {
"type": "string"
},
"score": {
"type": "number",
"format": "float"
}
}
},
"Version": { "Version": {
"type": "object", "type": "object",
"required": [ "required": [