KevinHuSh commited on
Commit
3e34eeb
·
1 Parent(s): b941fd0

make cites in conversation API configurable (#576)

Browse files

### What problem does this PR solve?

#566

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

api/db/services/dialog_service.py CHANGED
@@ -136,7 +136,7 @@ def chat(dialog, messages, **kwargs):
136
  chat_logger.info("User: {}|Assistant: {}".format(
137
  msg[-1]["content"], answer))
138
 
139
- if knowledges and prompt_config.get("quote", True):
140
  answer, idx = retrievaler.insert_citations(answer,
141
  [ck["content_ltks"]
142
  for ck in kbinfos["chunks"]],
 
136
  chat_logger.info("User: {}|Assistant: {}".format(
137
  msg[-1]["content"], answer))
138
 
139
+ if knowledges and (prompt_config.get("quote", True) and kwargs.get("quote", True)):
140
  answer, idx = retrievaler.insert_citations(answer,
141
  [ck["content_ltks"]
142
  for ck in kbinfos["chunks"]],
docs/conversation_api.md CHANGED
@@ -221,6 +221,7 @@ This will be called to get the answer to users' questions.
221
  |------|-------|----|----|
222
  | conversation_id| string | No | This is from calling /new_conversation.|
223
  | messages| json | No | All the conversation history stored here including the latest user's question.|
 
224
 
225
  ### Response
226
  ```json
 
221
  |------|-------|----|----|
222
  | conversation_id| string | No | This is from calling /new_conversation.|
223
  | messages| json | No | All the conversation history stored here including the latest user's question.|
224
+ | quote | bool | Yes | Default: true |
225
 
226
  ### Response
227
  ```json