From 3ee87f6be1c02b839b2cbe034692fc0a570951bd Mon Sep 17 00:00:00 2001 From: shil <73268510+0sengseng0@users.noreply.github.com> Date: Mon, 26 Feb 2024 16:21:24 +0800 Subject: [PATCH 1/2] change KnowledgeQueryResponse --- dbgpt/app/knowledge/api.py | 2 +- dbgpt/app/knowledge/request/request.py | 10 ---------- dbgpt/app/knowledge/request/response.py | 10 ++++++++++ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dbgpt/app/knowledge/api.py b/dbgpt/app/knowledge/api.py index ee8f1f767..875dbcb18 100644 --- a/dbgpt/app/knowledge/api.py +++ b/dbgpt/app/knowledge/api.py @@ -15,11 +15,11 @@ EntityExtractRequest, KnowledgeDocumentRequest, KnowledgeQueryRequest, - KnowledgeQueryResponse, KnowledgeSpaceRequest, KnowledgeSyncRequest, SpaceArgumentRequest, ) +from dbgpt.app.knowledge.request.response import KnowledgeQueryResponse from dbgpt.app.knowledge.service import KnowledgeService from dbgpt.app.openapi.api_v1.api_v1 import no_stream_generator, stream_generator from dbgpt.app.openapi.api_view_model import Result diff --git a/dbgpt/app/knowledge/request/request.py b/dbgpt/app/knowledge/request/request.py index 0b0e2795f..fbd6a697c 100644 --- a/dbgpt/app/knowledge/request/request.py +++ b/dbgpt/app/knowledge/request/request.py @@ -110,16 +110,6 @@ class ChunkQueryRequest(BaseModel): page_size: int = 20 -class KnowledgeQueryResponse: - """source: knowledge reference source""" - - source: str - """score: knowledge vector query similarity score""" - score: float = 0.0 - """text: raw text info""" - text: str - - class SpaceArgumentRequest(BaseModel): """argument: argument""" diff --git a/dbgpt/app/knowledge/request/response.py b/dbgpt/app/knowledge/request/response.py index eb835ed86..b7c9195e5 100644 --- a/dbgpt/app/knowledge/request/response.py +++ b/dbgpt/app/knowledge/request/response.py @@ -42,3 +42,13 @@ class SpaceQueryResponse(BaseModel): gmt_modified: str = None """doc_count: doc_count""" docs: int = None + + +class KnowledgeQueryResponse(BaseModel): + """source: knowledge reference source""" + + source: str + """score: knowledge vector query similarity score""" + score: float = 0.0 + """text: raw text info""" + text: str \ No newline at end of file From 1723d408be3c72ed24f7efd19ffd4992cf819bf0 Mon Sep 17 00:00:00 2001 From: Fangyin Cheng Date: Mon, 26 Feb 2024 21:49:23 +0800 Subject: [PATCH 2/2] chore: Format code --- dbgpt/app/knowledge/request/response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbgpt/app/knowledge/request/response.py b/dbgpt/app/knowledge/request/response.py index b7c9195e5..ccdc6519f 100644 --- a/dbgpt/app/knowledge/request/response.py +++ b/dbgpt/app/knowledge/request/response.py @@ -51,4 +51,4 @@ class KnowledgeQueryResponse(BaseModel): """score: knowledge vector query similarity score""" score: float = 0.0 """text: raw text info""" - text: str \ No newline at end of file + text: str