From 9d15666e5a51db26db94cba2fd18c2890f2c4751 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 23 Apr 2024 14:42:18 -0700 Subject: [PATCH] docs: update openapi.json (#1941) --- Makefile | 22 ++++++++++-------- website/static/openapi.json | 46 ++++++++++++++++++++++++++++++++++++- 2 files changed, 57 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 14cb6a8adbbf..880a35545862 100644 --- a/Makefile +++ b/Makefile @@ -24,16 +24,18 @@ bump-release-version: cargo ws version --allow-branch "r*" --no-individual-tags --force "*" update-openapi-doc: - curl http://localhost:8080/api-docs/openapi.json | jq ' \ - delpaths([ \ - ["paths", "/v1beta/chat/completions"], \ - ["paths", "/v1beta/search"], \ - ["components", "schemas", "CompletionRequest", "properties", "prompt"], \ - ["components", "schemas", "CompletionRequest", "properties", "debug_options"], \ - ["components", "schemas", "CompletionResponse", "properties", "debug_data"], \ - ["components", "schemas", "DebugData"], \ - ["components", "schemas", "DebugOptions"] \ - ])' | jq '.servers[0] |= { url: "https://playground.app.tabbyml.com", description: "Playground server" }' \ + curl http://localhost:8080/api-docs/openapi.json | jq ' \ + delpaths([ \ + ["paths", "/v1beta/chat/completions"], \ + ["paths", "/v1beta/search"], \ + ["paths", "/v1beta/server_setting"], \ + ["components", "schemas", "CompletionRequest", "properties", "prompt"], \ + ["components", "schemas", "CompletionRequest", "properties", "debug_options"], \ + ["components", "schemas", "CompletionResponse", "properties", "debug_data"], \ + ["components", "schemas", "DebugData"], \ + ["components", "schemas", "DebugOptions"], \ + ["components", "schemas", "ServerSetting"] \ + ])' | jq '.servers[0] |= { url: "https://playground.app.tabbyml.com", description: "Playground server" }' \ > website/static/openapi.json update-graphql-schema: diff --git a/website/static/openapi.json b/website/static/openapi.json index 5f7029d25e74..2e540a6efee2 100644 --- a/website/static/openapi.json +++ b/website/static/openapi.json @@ -7,7 +7,7 @@ "name": "Apache 2.0", "url": "https://github.com/TabbyML/tabby/blob/main/LICENSE" }, - "version": "0.8.3" + "version": "0.10.0" }, "servers": [ { @@ -313,6 +313,24 @@ ] } }, + "Declaration": { + "type": "object", + "description": "A snippet of declaration code that is relevant to the current completion request.", + "required": [ + "filepath", + "body" + ], + "properties": { + "filepath": { + "type": "string", + "description": "Filepath of the file where the snippet is from.\n- When the file belongs to the same workspace as the current file,\nthis is a relative filepath, use the same rule as [Segments::filepath].\n- When the file located outside the workspace, such as in a dependency package,\nthis is a file URI with an absolute filepath." + }, + "body": { + "type": "string", + "description": "Body of the snippet." + } + } + }, "HealthState": { "type": "object", "required": [ @@ -491,6 +509,32 @@ "description": "Content that appears after the cursor in the editor window.", "nullable": true }, + "filepath": { + "type": "string", + "description": "The relative path of the file that is being edited.\n- When [Segments::git_url] is set, this is the path of the file in the git repository.\n- When [Segments::git_url] is empty, this is the path of the file in the workspace.", + "nullable": true + }, + "git_url": { + "type": "string", + "description": "The remote URL of the current git repository.\nLeave this empty if the file is not in a git repository,\nor the git repository does not have a remote URL.", + "nullable": true + }, + "declarations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Declaration" + }, + "description": "The relevant declaration code snippets provided by the editor's LSP,\ncontain declarations of symbols extracted from [Segments::prefix].", + "nullable": true + }, + "relevant_snippets_from_changed_files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Snippet" + }, + "description": "The relevant code snippets extracted from recently edited files.\nThese snippets are selected from candidates found within code chunks\nbased on the edited location.\nThe current editing file is excluded from the search candidates.\n\nWhen provided alongside [Segments::declarations], the snippets have\nalready been deduplicated to ensure no duplication with entries\nin [Segments::declarations].\n\nSorted in descending order of [Snippet::score].", + "nullable": true + }, "clipboard": { "type": "string", "description": "Clipboard content when requesting code completion.",