mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-16 19:16:05 +08:00
Update docnm_kwd to doc_name (#939)
### What problem does this PR solve? Update docnm_kwd to doc_name #908 ### Type of change - [x] Refactoring
This commit is contained in:
parent
65677f65c9
commit
7d8e03ec38
@ -203,6 +203,9 @@ def completion():
|
|||||||
try:
|
try:
|
||||||
for ans in chat(dia, msg, True, **req):
|
for ans in chat(dia, msg, True, **req):
|
||||||
fillin_conv(ans)
|
fillin_conv(ans)
|
||||||
|
for chunk_i in ans['reference'].get('chunks', []):
|
||||||
|
chunk_i['doc_name'] = chunk_i['docnm_kwd']
|
||||||
|
chunk_i.pop('docnm_kwd')
|
||||||
yield "data:"+json.dumps({"retcode": 0, "retmsg": "", "data": ans}, ensure_ascii=False) + "\n\n"
|
yield "data:"+json.dumps({"retcode": 0, "retmsg": "", "data": ans}, ensure_ascii=False) + "\n\n"
|
||||||
API4ConversationService.append_message(conv.id, conv.to_dict())
|
API4ConversationService.append_message(conv.id, conv.to_dict())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -225,6 +228,11 @@ def completion():
|
|||||||
fillin_conv(ans)
|
fillin_conv(ans)
|
||||||
API4ConversationService.append_message(conv.id, conv.to_dict())
|
API4ConversationService.append_message(conv.id, conv.to_dict())
|
||||||
break
|
break
|
||||||
|
|
||||||
|
for chunk_i in answer['reference'].get('chunks',[]):
|
||||||
|
chunk_i['doc_name'] = chunk_i['docnm_kwd']
|
||||||
|
chunk_i.pop('docnm_kwd')
|
||||||
|
|
||||||
return get_json_result(data=answer)
|
return get_json_result(data=answer)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -239,7 +247,13 @@ def get(conversation_id):
|
|||||||
if not e:
|
if not e:
|
||||||
return get_data_error_result(retmsg="Conversation not found!")
|
return get_data_error_result(retmsg="Conversation not found!")
|
||||||
|
|
||||||
return get_json_result(data=conv.to_dict())
|
conv = conv.to_dict()
|
||||||
|
for referenct_i in conv['reference']:
|
||||||
|
for chunk_i in referenct_i['chunks']:
|
||||||
|
if 'docnm_kwd' in chunk_i.keys():
|
||||||
|
chunk_i['doc_name'] = chunk_i['docnm_kwd']
|
||||||
|
chunk_i.pop('docnm_kwd')
|
||||||
|
return get_json_result(data=conv)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return server_error_response(e)
|
return server_error_response(e)
|
||||||
|
|
||||||
@ -430,7 +444,7 @@ def list_kb_docs():
|
|||||||
return server_error_response(e)
|
return server_error_response(e)
|
||||||
|
|
||||||
|
|
||||||
@manager.route('/document/rm', methods=['POST'])
|
@manager.route('/document', methods=['DELETE'])
|
||||||
# @login_required
|
# @login_required
|
||||||
def document_rm():
|
def document_rm():
|
||||||
token = request.headers.get('Authorization').split()[1]
|
token = request.headers.get('Authorization').split()[1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user