Skip to content

Commit

Permalink
Merge pull request #603 from Abirdcfly/pghis
Browse files Browse the repository at this point in the history
feat: chat info store to pg
  • Loading branch information
bjwswang authored Jan 25, 2024
2 parents 528f1de + 3dd25d3 commit 42fd7db
Show file tree
Hide file tree
Showing 21 changed files with 1,028 additions and 399 deletions.
112 changes: 56 additions & 56 deletions apiserver/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/chat.Conversation"
"$ref": "#/definitions/storage.Conversation"
}
}
},
Expand Down Expand Up @@ -188,7 +188,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/chat.Conversation"
"$ref": "#/definitions/storage.Conversation"
}
},
"400": {
Expand Down Expand Up @@ -1012,37 +1012,6 @@ const docTemplate = `{
}
}
},
"chat.Conversation": {
"type": "object",
"properties": {
"app_name": {
"type": "string",
"example": "chat-with-llm"
},
"app_namespace": {
"type": "string",
"example": "arcadia"
},
"id": {
"type": "string",
"example": "5a41f3ca-763b-41ec-91c3-4bbbb00736d0"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/definitions/chat.Message"
}
},
"started_at": {
"type": "string",
"example": "2023-12-21T10:21:06.389359092+08:00"
},
"updated_at": {
"type": "string",
"example": "2023-12-22T10:21:06.389359092+08:00"
}
}
},
"chat.ConversationReqBody": {
"type": "object",
"required": [
Expand Down Expand Up @@ -1076,29 +1045,6 @@ const docTemplate = `{
}
}
},
"chat.Message": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"example": "旷工最小计算单位为0.5天。"
},
"id": {
"type": "string",
"example": "4f3546dd-5404-4bf8-a3bc-4fa3f9a7ba24"
},
"query": {
"type": "string",
"example": "旷工最小计算单位为多少天?"
},
"references": {
"type": "array",
"items": {
"$ref": "#/definitions/retriever.Reference"
}
}
}
},
"chat.MessageReqBody": {
"type": "object",
"required": [
Expand Down Expand Up @@ -1351,6 +1297,60 @@ const docTemplate = `{
"type": "string"
}
}
},
"storage.Conversation": {
"type": "object",
"properties": {
"app_name": {
"type": "string",
"example": "chat-with-llm"
},
"app_namespace": {
"type": "string",
"example": "arcadia"
},
"id": {
"type": "string",
"example": "5a41f3ca-763b-41ec-91c3-4bbbb00736d0"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/definitions/storage.Message"
}
},
"started_at": {
"type": "string",
"example": "2023-12-21T10:21:06.389359092+08:00"
},
"updated_at": {
"type": "string",
"example": "2023-12-22T10:21:06.389359092+08:00"
}
}
},
"storage.Message": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"example": "旷工最小计算单位为0.5天。"
},
"id": {
"type": "string",
"example": "4f3546dd-5404-4bf8-a3bc-4fa3f9a7ba24"
},
"query": {
"type": "string",
"example": "旷工最小计算单位为多少天?"
},
"references": {
"type": "array",
"items": {
"$ref": "#/definitions/retriever.Reference"
}
}
}
}
}
}`
Expand Down
112 changes: 56 additions & 56 deletions apiserver/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/chat.Conversation"
"$ref": "#/definitions/storage.Conversation"
}
}
},
Expand Down Expand Up @@ -177,7 +177,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/chat.Conversation"
"$ref": "#/definitions/storage.Conversation"
}
},
"400": {
Expand Down Expand Up @@ -1001,37 +1001,6 @@
}
}
},
"chat.Conversation": {
"type": "object",
"properties": {
"app_name": {
"type": "string",
"example": "chat-with-llm"
},
"app_namespace": {
"type": "string",
"example": "arcadia"
},
"id": {
"type": "string",
"example": "5a41f3ca-763b-41ec-91c3-4bbbb00736d0"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/definitions/chat.Message"
}
},
"started_at": {
"type": "string",
"example": "2023-12-21T10:21:06.389359092+08:00"
},
"updated_at": {
"type": "string",
"example": "2023-12-22T10:21:06.389359092+08:00"
}
}
},
"chat.ConversationReqBody": {
"type": "object",
"required": [
Expand Down Expand Up @@ -1065,29 +1034,6 @@
}
}
},
"chat.Message": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"example": "旷工最小计算单位为0.5天。"
},
"id": {
"type": "string",
"example": "4f3546dd-5404-4bf8-a3bc-4fa3f9a7ba24"
},
"query": {
"type": "string",
"example": "旷工最小计算单位为多少天?"
},
"references": {
"type": "array",
"items": {
"$ref": "#/definitions/retriever.Reference"
}
}
}
},
"chat.MessageReqBody": {
"type": "object",
"required": [
Expand Down Expand Up @@ -1340,6 +1286,60 @@
"type": "string"
}
}
},
"storage.Conversation": {
"type": "object",
"properties": {
"app_name": {
"type": "string",
"example": "chat-with-llm"
},
"app_namespace": {
"type": "string",
"example": "arcadia"
},
"id": {
"type": "string",
"example": "5a41f3ca-763b-41ec-91c3-4bbbb00736d0"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/definitions/storage.Message"
}
},
"started_at": {
"type": "string",
"example": "2023-12-21T10:21:06.389359092+08:00"
},
"updated_at": {
"type": "string",
"example": "2023-12-22T10:21:06.389359092+08:00"
}
}
},
"storage.Message": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"example": "旷工最小计算单位为0.5天。"
},
"id": {
"type": "string",
"example": "4f3546dd-5404-4bf8-a3bc-4fa3f9a7ba24"
},
"query": {
"type": "string",
"example": "旷工最小计算单位为多少天?"
},
"references": {
"type": "array",
"items": {
"$ref": "#/definitions/retriever.Reference"
}
}
}
}
}
}
Loading

0 comments on commit 42fd7db

Please sign in to comment.