diff --git a/openapi-full.json b/openapi-full.json index 60054b6c5fa..affd08bced4 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -6086,6 +6086,169 @@ } } }, + "/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/summarize": { + "get": { + "operationId": "chat-summarize-chat", + "summary": "Summarize next bunch of chat messages from a given offset", + "tags": [ + "chat" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "token", + "in": "path", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-z0-9]{4,30}$" + } + }, + { + "name": "fromMessageId", + "in": "query", + "description": "Offset from where on the summary should be generated", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1 + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "201": { + "description": "Summary was scheduled", + "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": [ + "taskId", + "nextOffset" + ], + "properties": { + "taskId": { + "type": "integer", + "format": "int64" + }, + "nextOffset": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "No AI provider available or summarizing failed", + "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": [ + "error" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "ai-no-provider", + "ai-error" + ] + } + } + } + } + } + } + } + } + } + }, + "204": { + "description": "No messages found to summarize" + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}": { "delete": { "operationId": "chat-delete-message", diff --git a/openapi.json b/openapi.json index c14042aad27..43abf5b64aa 100644 --- a/openapi.json +++ b/openapi.json @@ -5973,6 +5973,169 @@ } } }, + "/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/summarize": { + "get": { + "operationId": "chat-summarize-chat", + "summary": "Summarize next bunch of chat messages from a given offset", + "tags": [ + "chat" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "token", + "in": "path", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-z0-9]{4,30}$" + } + }, + { + "name": "fromMessageId", + "in": "query", + "description": "Offset from where on the summary should be generated", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1 + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "201": { + "description": "Summary was scheduled", + "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": [ + "taskId", + "nextOffset" + ], + "properties": { + "taskId": { + "type": "integer", + "format": "int64" + }, + "nextOffset": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "No AI provider available or summarizing failed", + "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": [ + "error" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "ai-no-provider", + "ai-error" + ] + } + } + } + } + } + } + } + } + } + }, + "204": { + "description": "No messages found to summarize" + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}": { "delete": { "operationId": "chat-delete-message", diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index 3cddddd4be9..863a20165ab 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -361,6 +361,23 @@ export type paths = { patch?: never; trace?: never; }; + "/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/summarize": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Summarize next bunch of chat messages from a given offset */ + get: operations["chat-summarize-chat"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}": { parameters: { query?: never; @@ -4090,6 +4107,77 @@ export interface operations { }; }; }; + "chat-summarize-chat": { + parameters: { + query: { + /** @description Offset from where on the summary should be generated */ + fromMessageId: number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + token: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Summary was scheduled */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** Format: int64 */ + taskId: number; + /** Format: int64 */ + nextOffset: number; + }; + }; + }; + }; + }; + /** @description No messages found to summarize */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description No AI provider available or summarizing failed */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** @enum {string} */ + error: "ai-no-provider" | "ai-error"; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "text/plain": string; + }; + }; + }; + }; "chat-edit-message": { parameters: { query?: never; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index ee0fa97d878..80e1f941a4a 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -361,6 +361,23 @@ export type paths = { patch?: never; trace?: never; }; + "/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/summarize": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Summarize next bunch of chat messages from a given offset */ + get: operations["chat-summarize-chat"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}": { parameters: { query?: never; @@ -3571,6 +3588,77 @@ export interface operations { }; }; }; + "chat-summarize-chat": { + parameters: { + query: { + /** @description Offset from where on the summary should be generated */ + fromMessageId: number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + apiVersion: "v1"; + token: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Summary was scheduled */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** Format: int64 */ + taskId: number; + /** Format: int64 */ + nextOffset: number; + }; + }; + }; + }; + }; + /** @description No messages found to summarize */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description No AI provider available or summarizing failed */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** @enum {string} */ + error: "ai-no-provider" | "ai-error"; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "text/plain": string; + }; + }; + }; + }; "chat-edit-message": { parameters: { query?: never;