Skip to content

Commit

Permalink
Merge pull request #770 from 0xff-dev/chart-api
Browse files Browse the repository at this point in the history
refactor: change the report's scatter structure
  • Loading branch information
bjwswang authored Feb 27, 2024
2 parents f944477 + 2f779b2 commit 7beebdf
Show file tree
Hide file tree
Showing 5 changed files with 329 additions and 90 deletions.
84 changes: 64 additions & 20 deletions apiserver/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,70 @@ const docTemplate = `{
}
}
}
},
"/rags/scatter": {
"get": {
"description": "Get scatter data of a rag",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"RAG"
],
"summary": "Get scatter data of a rag",
"parameters": [
{
"type": "string",
"description": "rag name",
"name": "ragName",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Name of the bucket",
"name": "namespace",
"in": "header",
"required": true
},
{
"type": "string",
"description": "application name",
"name": "appName",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/rag.ReportDetail"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -1567,12 +1631,6 @@ const docTemplate = `{
"$ref": "#/definitions/rag.RadarData"
}
},
"scatterChart": {
"type": "array",
"items": {
"$ref": "#/definitions/rag.ScatterData"
}
},
"summary": {
"description": "TODO",
"type": "string"
Expand Down Expand Up @@ -1631,20 +1689,6 @@ const docTemplate = `{
}
}
},
"rag.ScatterData": {
"type": "object",
"properties": {
"color": {
"type": "string"
},
"score": {
"type": "number"
},
"type": {
"type": "string"
}
}
},
"rag.TotalScoreData": {
"type": "object",
"properties": {
Expand Down
84 changes: 64 additions & 20 deletions apiserver/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,70 @@
}
}
}
},
"/rags/scatter": {
"get": {
"description": "Get scatter data of a rag",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"RAG"
],
"summary": "Get scatter data of a rag",
"parameters": [
{
"type": "string",
"description": "rag name",
"name": "ragName",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Name of the bucket",
"name": "namespace",
"in": "header",
"required": true
},
{
"type": "string",
"description": "application name",
"name": "appName",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/rag.ReportDetail"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -1561,12 +1625,6 @@
"$ref": "#/definitions/rag.RadarData"
}
},
"scatterChart": {
"type": "array",
"items": {
"$ref": "#/definitions/rag.ScatterData"
}
},
"summary": {
"description": "TODO",
"type": "string"
Expand Down Expand Up @@ -1625,20 +1683,6 @@
}
}
},
"rag.ScatterData": {
"type": "object",
"properties": {
"color": {
"type": "string"
},
"score": {
"type": "number"
},
"type": {
"type": "string"
}
}
},
"rag.TotalScoreData": {
"type": "object",
"properties": {
Expand Down
56 changes: 43 additions & 13 deletions apiserver/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ definitions:
items:
$ref: '#/definitions/rag.RadarData'
type: array
scatterChart:
items:
$ref: '#/definitions/rag.ScatterData'
type: array
summary:
description: TODO
type: string
Expand Down Expand Up @@ -249,15 +245,6 @@ definitions:
totalScore:
type: number
type: object
rag.ScatterData:
properties:
color:
type: string
score:
type: number
type:
type: string
type: object
rag.TotalScoreData:
properties:
color:
Expand Down Expand Up @@ -1348,6 +1335,49 @@ paths:
summary: Get a summary of rag
tags:
- RAG
/rags/scatter:
get:
consumes:
- application/json
description: Get scatter data of a rag
parameters:
- description: rag name
in: query
name: ragName
required: true
type: string
- description: Name of the bucket
in: header
name: namespace
required: true
type: string
- description: application name
in: query
name: appName
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/rag.ReportDetail'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Get scatter data of a rag
tags:
- RAG
securityDefinitions:
ApiKeyAuth:
description: API token for authorization
Expand Down
Loading

0 comments on commit 7beebdf

Please sign in to comment.