Skip to content

Commit

Permalink
Merge pull request #655 from Abirdcfly/chat_resp_time
Browse files Browse the repository at this point in the history
feat: add chat latency and api: generate prompt starters
  • Loading branch information
nkwangleiGIT authored Jan 27, 2024
2 parents b047b43 + 5ec0900 commit 5438d1a
Show file tree
Hide file tree
Showing 16 changed files with 534 additions and 80 deletions.
64 changes: 64 additions & 0 deletions apiserver/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,61 @@ const docTemplate = `{
}
}
},
"/prompt-starter": {
"post": {
"description": "get app's prompt starters",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"application"
],
"summary": "get app's prompt starters",
"parameters": [
{
"type": "integer",
"description": "how many prompts you need should \u003e 0 and \u003c 10",
"name": "limit",
"in": "query"
},
{
"description": "query params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/chat.APPMetadata"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/chat.ErrorResp"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/chat.ErrorResp"
}
}
}
}
},
"/versioneddataset/files/csv": {
"get": {
"description": "Read a file line by line",
Expand Down Expand Up @@ -991,6 +1046,11 @@ const docTemplate = `{
"type": "string",
"example": "2023-12-21T10:21:06.389359092+08:00"
},
"latency": {
"description": "Latency(ms) is how much time the server cost to process a certain request.",
"type": "integer",
"example": 1000
},
"message": {
"description": "Message is what AI say",
"type": "string",
Expand Down Expand Up @@ -1396,6 +1456,10 @@ const docTemplate = `{
"type": "string",
"example": "4f3546dd-5404-4bf8-a3bc-4fa3f9a7ba24"
},
"latency": {
"type": "integer",
"example": 1000
},
"query": {
"type": "string",
"example": "旷工最小计算单位为多少天?"
Expand Down
64 changes: 64 additions & 0 deletions apiserver/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,61 @@
}
}
},
"/prompt-starter": {
"post": {
"description": "get app's prompt starters",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"application"
],
"summary": "get app's prompt starters",
"parameters": [
{
"type": "integer",
"description": "how many prompts you need should \u003e 0 and \u003c 10",
"name": "limit",
"in": "query"
},
{
"description": "query params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/chat.APPMetadata"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/chat.ErrorResp"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/chat.ErrorResp"
}
}
}
}
},
"/versioneddataset/files/csv": {
"get": {
"description": "Read a file line by line",
Expand Down Expand Up @@ -980,6 +1035,11 @@
"type": "string",
"example": "2023-12-21T10:21:06.389359092+08:00"
},
"latency": {
"description": "Latency(ms) is how much time the server cost to process a certain request.",
"type": "integer",
"example": 1000
},
"message": {
"description": "Message is what AI say",
"type": "string",
Expand Down Expand Up @@ -1385,6 +1445,10 @@
"type": "string",
"example": "4f3546dd-5404-4bf8-a3bc-4fa3f9a7ba24"
},
"latency": {
"type": "integer",
"example": 1000
},
"query": {
"type": "string",
"example": "旷工最小计算单位为多少天?"
Expand Down
44 changes: 44 additions & 0 deletions apiserver/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ definitions:
description: CreatedAt is the time when the message is created
example: "2023-12-21T10:21:06.389359092+08:00"
type: string
latency:
description: Latency(ms) is how much time the server cost to process a certain
request.
example: 1000
type: integer
message:
description: Message is what AI say
example: 旷工最小计算单位为0.5天。
Expand Down Expand Up @@ -337,6 +342,9 @@ definitions:
id:
example: 4f3546dd-5404-4bf8-a3bc-4fa3f9a7ba24
type: string
latency:
example: 1000
type: integer
query:
example: 旷工最小计算单位为多少天?
type: string
Expand Down Expand Up @@ -898,6 +906,42 @@ paths:
summary: Statistics file information
tags:
- MinioAPI
/prompt-starter:
post:
consumes:
- application/json
description: get app's prompt starters
parameters:
- description: how many prompts you need should > 0 and < 10
in: query
name: limit
type: integer
- description: query params
in: body
name: request
required: true
schema:
$ref: '#/definitions/chat.APPMetadata'
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/chat.ErrorResp'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/chat.ErrorResp'
summary: get app's prompt starters
tags:
- application
/versioneddataset/files/csv:
get:
consumes:
Expand Down
Loading

0 comments on commit 5438d1a

Please sign in to comment.