Skip to content

Commit

Permalink
Merge pull request #1384 from ManishMadan2882/main
Browse files Browse the repository at this point in the history
Fix: empty doc selection in /stream
  • Loading branch information
dartpain authored Oct 29, 2024
2 parents 631e77c + 1627d42 commit d9787e8
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions application/api/answer/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,6 @@ class Stream(Resource):
"prompt_id": fields.String(
required=False, default="default", description="Prompt ID"
),
"selectedDocs": fields.String(
required=False, description="Selected documents"
),
"chunks": fields.Integer(
required=False, default=2, description="Number of chunks"
),
Expand Down Expand Up @@ -303,10 +300,9 @@ def post(self):
history = json.loads(history)
conversation_id = data.get("conversation_id")
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)
retriever_name = data.get("retriever", "classic")

Expand All @@ -333,7 +329,8 @@ def post(self):
)

prompt = get_prompt(prompt_id)

if "isNoneDoc" in data and data["isNoneDoc"] is True:
chunks = 0
retriever = RetrieverCreator.create_retriever(
retriever_name,
question=question,
Expand Down

0 comments on commit d9787e8

Please sign in to comment.