mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
fix(isNoneDoc): empty doc assumed as default
This commit is contained in:
@@ -269,9 +269,6 @@ class Stream(Resource):
|
|||||||
"prompt_id": fields.String(
|
"prompt_id": fields.String(
|
||||||
required=False, default="default", description="Prompt ID"
|
required=False, default="default", description="Prompt ID"
|
||||||
),
|
),
|
||||||
"selectedDocs": fields.String(
|
|
||||||
required=False, description="Selected documents"
|
|
||||||
),
|
|
||||||
"chunks": fields.Integer(
|
"chunks": fields.Integer(
|
||||||
required=False, default=2, description="Number of chunks"
|
required=False, default=2, description="Number of chunks"
|
||||||
),
|
),
|
||||||
@@ -303,10 +300,9 @@ class Stream(Resource):
|
|||||||
history = json.loads(history)
|
history = json.loads(history)
|
||||||
conversation_id = data.get("conversation_id")
|
conversation_id = data.get("conversation_id")
|
||||||
prompt_id = data.get("prompt_id", "default")
|
prompt_id = data.get("prompt_id", "default")
|
||||||
if "selectedDocs" in data and data["selectedDocs"] is None:
|
|
||||||
chunks = 0
|
|
||||||
else:
|
chunks = int(data.get("chunks", 2))
|
||||||
chunks = int(data.get("chunks", 2))
|
|
||||||
token_limit = data.get("token_limit", settings.DEFAULT_MAX_HISTORY)
|
token_limit = data.get("token_limit", settings.DEFAULT_MAX_HISTORY)
|
||||||
retriever_name = data.get("retriever", "classic")
|
retriever_name = data.get("retriever", "classic")
|
||||||
|
|
||||||
@@ -333,7 +329,8 @@ class Stream(Resource):
|
|||||||
)
|
)
|
||||||
|
|
||||||
prompt = get_prompt(prompt_id)
|
prompt = get_prompt(prompt_id)
|
||||||
|
if "isNoneDoc" in data and data["isNoneDoc"] is True:
|
||||||
|
chunks = 0
|
||||||
retriever = RetrieverCreator.create_retriever(
|
retriever = RetrieverCreator.create_retriever(
|
||||||
retriever_name,
|
retriever_name,
|
||||||
question=question,
|
question=question,
|
||||||
|
|||||||
Reference in New Issue
Block a user