Skip to content

Commit

Permalink
add doc ids in API: completion (infiniflow#827)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?
infiniflow#808 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
  • Loading branch information
KevinHuSh committed May 17, 2024
1 parent a1586e0 commit b3c923d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/db/services/dialog_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ def chat(dialog, messages, stream=True, **kwargs):
else:
kbinfos = retrievaler.retrieval(" ".join(questions), embd_mdl, dialog.tenant_id, dialog.kb_ids, 1, dialog.top_n,
dialog.similarity_threshold,
dialog.vector_similarity_weight, top=1024, aggs=False)
dialog.vector_similarity_weight,
doc_ids=kwargs.get("doc_ids", "").split(","),
top=1024, aggs=False)
knowledges = [ck["content_with_weight"] for ck in kbinfos["chunks"]]
chat_logger.info(
"{}->{}".format(" ".join(questions), "\n->".join(knowledges)))
Expand Down

0 comments on commit b3c923d

Please sign in to comment.