Skip to content

Commit

Permalink
update swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanHH86 committed Dec 18, 2024
1 parent 35b45d2 commit 5bfcb43
Show file tree
Hide file tree
Showing 3 changed files with 225 additions and 35 deletions.
96 changes: 85 additions & 11 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down
99 changes: 85 additions & 14 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -17041,8 +17112,6 @@
}
}
},
<<<<<<< HEAD
=======
"types.CreateTag": {
"type": "object",
"required": [
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -17754,6 +17811,20 @@
}
}
},
"types.ModelPredictReq": {
"type": "object",
"properties": {
"current_user": {
"type": "string"
},
"input": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"types.ModelResp": {
"type": "object",
"properties": {
Expand Down
65 changes: 55 additions & 10 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,6 @@ definitions:
required:
- token
type: object
<<<<<<< HEAD
=======
types.CreateTag:
properties:
built_in:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5bfcb43

Please sign in to comment.