From 5bfcb4351125d60f8d9b186e76f28d40495907d9 Mon Sep 17 00:00:00 2001 From: Sean <38311363@qq.com> Date: Wed, 18 Dec 2024 11:04:42 +0800 Subject: [PATCH] update swagger --- docs/docs.go | 96 +++++++++++++++++++++++++++++++++++++++------ docs/swagger.json | 99 ++++++++++++++++++++++++++++++++++++++++------- docs/swagger.yaml | 65 ++++++++++++++++++++++++++----- 3 files changed, 225 insertions(+), 35 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index cf8b79d2..4fe703f2 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -4023,6 +4023,77 @@ const docTemplate = `{ } } }, + "/models/{namespace}/{name}/predict": { + "post": { + "security": [ + { + "ApiKey": [] + } + ], + "description": "invoke model prediction", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Model" + ], + "summary": "Invoke model prediction", + "parameters": [ + { + "type": "string", + "description": "namespace", + "name": "namespace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "current user", + "name": "current_user", + "in": "query" + }, + { + "description": "input for model prediction", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.ModelPredictReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/types.APIBadRequest" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/types.APIInternalServerError" + } + } + } + } + }, "/models/{namespace}/{name}/relations": { "get": { "security": [ @@ -17080,17 +17151,6 @@ const docTemplate = `{ } } }, - "types.CreateUserResourceReq": { - "type": "object", - "properties": { - "order_details": { - "type": "array", - "items": { - "$ref": "#/definitions/types.AcctOrderDetailReq" - } - } - } - }, "types.CreateUserTokenRequest": { "type": "object", "properties": { @@ -17762,6 +17822,20 @@ const docTemplate = `{ } } }, + "types.ModelPredictReq": { + "type": "object", + "properties": { + "current_user": { + "type": "string" + }, + "input": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, "types.ModelResp": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index c55503dd..b0e864e6 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -4012,6 +4012,77 @@ } } }, + "/models/{namespace}/{name}/predict": { + "post": { + "security": [ + { + "ApiKey": [] + } + ], + "description": "invoke model prediction", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Model" + ], + "summary": "Invoke model prediction", + "parameters": [ + { + "type": "string", + "description": "namespace", + "name": "namespace", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "current user", + "name": "current_user", + "in": "query" + }, + { + "description": "input for model prediction", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.ModelPredictReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/types.APIBadRequest" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/types.APIInternalServerError" + } + } + } + } + }, "/models/{namespace}/{name}/relations": { "get": { "security": [ @@ -17041,8 +17112,6 @@ } } }, -<<<<<<< HEAD -======= "types.CreateTag": { "type": "object", "required": [ @@ -17071,18 +17140,6 @@ } } }, - "types.CreateUserResourceReq": { - "type": "object", - "properties": { - "order_details": { - "type": "array", - "items": { - "$ref": "#/definitions/types.AcctOrderDetailReq" - } - } - } - }, ->>>>>>> 43adc0f4 ([Tags] add tag management feature and UT for ce/ee/saas) "types.CreateUserTokenRequest": { "type": "object", "properties": { @@ -17754,6 +17811,20 @@ } } }, + "types.ModelPredictReq": { + "type": "object", + "properties": { + "current_user": { + "type": "string" + }, + "input": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, "types.ModelResp": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 623f9236..4ba5c8dc 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1236,8 +1236,6 @@ definitions: required: - token type: object -<<<<<<< HEAD -======= types.CreateTag: properties: built_in: @@ -1257,14 +1255,6 @@ definitions: - name - scope type: object - types.CreateUserResourceReq: - properties: - order_details: - items: - $ref: '#/definitions/types.AcctOrderDetailReq' - type: array - type: object ->>>>>>> 43adc0f4 ([Tags] add tag management feature and UT for ce/ee/saas) types.CreateUserTokenRequest: properties: application: @@ -1716,6 +1706,15 @@ definitions: description: 'widget UI style: generation,chat' example: generation type: object + types.ModelPredictReq: + properties: + current_user: + type: string + input: + type: string + version: + type: string + type: object types.ModelResp: properties: description: @@ -6668,6 +6667,52 @@ paths: summary: Stop a finetune instance tags: - Model + /models/{namespace}/{name}/predict: + post: + consumes: + - application/json + description: invoke model prediction + parameters: + - description: namespace + in: path + name: namespace + required: true + type: string + - description: name + in: path + name: name + required: true + type: string + - description: current user + in: query + name: current_user + type: string + - description: input for model prediction + in: body + name: body + required: true + schema: + $ref: '#/definitions/types.ModelPredictReq' + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + "400": + description: Bad request + schema: + $ref: '#/definitions/types.APIBadRequest' + "500": + description: Internal server error + schema: + $ref: '#/definitions/types.APIInternalServerError' + security: + - ApiKey: [] + summary: Invoke model prediction + tags: + - Model /models/{namespace}/{name}/relations: get: consumes: