KevinHuSh commited on
Commit
dcd7f0f
·
1 Parent(s): f6eb84a

add quota config in dialog conf (#339)

Browse files

### What problem does this PR solve?

Issue link:#337

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

api/apps/chunk_app.py CHANGED
@@ -60,7 +60,7 @@ def list():
60
  for id in sres.ids:
61
  d = {
62
  "chunk_id": id,
63
- "content_with_weight": rmSpace(sres.highlight[id]) if question else sres.field[id].get(
64
  "content_with_weight", ""),
65
  "doc_id": sres.field[id]["doc_id"],
66
  "docnm_kwd": sres.field[id]["docnm_kwd"],
 
60
  for id in sres.ids:
61
  d = {
62
  "chunk_id": id,
63
+ "content_with_weight": rmSpace(sres.highlight[id]) if question and id in sres.highlight else sres.field[id].get(
64
  "content_with_weight", ""),
65
  "doc_id": sres.field[id]["doc_id"],
66
  "docnm_kwd": sres.field[id]["docnm_kwd"],
api/apps/conversation_app.py CHANGED
@@ -241,7 +241,7 @@ def chat(dialog, messages, **kwargs):
241
  chat_logger.info("User: {}|Assistant: {}".format(
242
  msg[-1]["content"], answer))
243
 
244
- if knowledges:
245
  answer, idx = retrievaler.insert_citations(answer,
246
  [ck["content_ltks"]
247
  for ck in kbinfos["chunks"]],
 
241
  chat_logger.info("User: {}|Assistant: {}".format(
242
  msg[-1]["content"], answer))
243
 
244
+ if knowledges and prompt_config.get("quote", True):
245
  answer, idx = retrievaler.insert_citations(answer,
246
  [ck["content_ltks"]
247
  for ck in kbinfos["chunks"]],