diff options
author | jld3103 <jld3103yt@gmail.com> | 2023-07-31 11:58:54 +0200 |
---|---|---|
committer | Julien Veyssier <julien-nc@posteo.net> | 2023-07-31 14:09:12 +0200 |
commit | dca22c1d2c22f9931e5fc4cc22fe3c5c8be50b36 (patch) | |
tree | 6f2cc4d7453836961527e800e5beb8bc41fbe227 /core/openapi.json | |
parent | 8c846ce1035052d9450495da2a056e31e8560899 (diff) | |
download | nextcloud-server-dca22c1d2c22f9931e5fc4cc22fe3c5c8be50b36.tar.gz nextcloud-server-dca22c1d2c22f9931e5fc4cc22fe3c5c8be50b36.zip |
core: Document text processing API
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'core/openapi.json')
-rw-r--r-- | core/openapi.json | 485 |
1 files changed, 485 insertions, 0 deletions
diff --git a/core/openapi.json b/core/openapi.json index 89edc4114f2..de65f08a4ee 100644 --- a/core/openapi.json +++ b/core/openapi.json @@ -372,6 +372,70 @@ } } }, + "TextProcessingTask": { + "type": "object", + "required": [ + "id", + "type", + "status", + "userId", + "appId", + "input", + "output", + "identifier" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "type": { + "type": "string" + }, + "status": { + "oneOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "integer", + "format": "int64" + }, + { + "type": "integer", + "format": "int64" + }, + { + "type": "integer", + "format": "int64" + }, + { + "type": "integer", + "format": "int64" + } + ] + }, + "userId": { + "type": "string", + "nullable": true + }, + "appId": { + "type": "string" + }, + "input": { + "type": "string" + }, + "output": { + "type": "string", + "nullable": true + }, + "identifier": { + "type": "string" + } + } + }, "UnifiedSearchProvider": { "type": "object", "required": [ @@ -4181,6 +4245,427 @@ } } }, + "/ocs/v2.php/textprocessing/tasktypes": { + "get": { + "operationId": "text_processing_api-task-types", + "summary": "This endpoint returns all available LanguageModel task types", + "tags": [ + "text_processing_api" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "types" + ], + "properties": { + "types": { + "type": "object", + "required": [ + "id", + "name", + "description" + ], + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/textprocessing/schedule": { + "post": { + "operationId": "text_processing_api-schedule", + "summary": "This endpoint allows scheduling a language model task", + "tags": [ + "text_processing_api" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "input", + "in": "query", + "description": "Input text", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "Type of the task", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "appId", + "in": "query", + "description": "ID of the app that will execute the task", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "identifier", + "in": "query", + "description": "An arbitrary identifier for the task", + "schema": { + "type": "string", + "default": "" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "Task scheduled successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "task" + ], + "properties": { + "task": { + "$ref": "#/components/schemas/TextProcessingTask" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "Scheduling task is not possible", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "412": { + "description": "Scheduling task is not possible", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/textprocessing/task/{id}": { + "get": { + "operationId": "text_processing_api-get-task", + "summary": "This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update.", + "tags": [ + "text_processing_api" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The id of the task", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "description": "Task returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "task" + ], + "properties": { + "task": { + "$ref": "#/components/schemas/TextProcessingTask" + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Task not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, "/status.php": { "get": { "operationId": "get-status", |