请假申请直接问答dify知识库报错bug优化
This commit is contained in:
1 parent
1b56810cc7
commit
f877f61efd
2 files changed
+3
-2
No files matched your search
@@ -303,7 +303,7 @@ def test_agent(id):
|
|||||||
payload = {'inputs': {'query': '系统连通性测试,请简短回复OK。'}, 'response_mode': 'blocking', 'user': 'admin_test'}
|
payload = {'inputs': {'query': '系统连通性测试,请简短回复OK。'}, 'response_mode': 'blocking', 'user': 'admin_test'}
|
||||||
else:
|
else:
|
||||||
request_url = DifyService._build_chat_messages_url(base_url)
|
request_url = DifyService._build_chat_messages_url(base_url)
|
||||||
payload = {'inputs': {}, 'query': '系统连通性测试,请简短回复OK。', 'response_mode': 'blocking', 'conversation_id': '', 'user': 'admin_test'}
|
payload = {'inputs': {}, 'query': '系统连通性测试,请简短回复OK。', 'response_mode': 'blocking', 'user': 'admin_test'}
|
||||||
headers = {'Authorization': f'Bearer {agent.dify_api_key}', 'Content-Type': 'application/json'}
|
headers = {'Authorization': f'Bearer {agent.dify_api_key}', 'Content-Type': 'application/json'}
|
||||||
try:
|
try:
|
||||||
resp = requests.post(request_url, headers=headers, json=payload, timeout=(5, 25))
|
resp = requests.post(request_url, headers=headers, json=payload, timeout=(5, 25))
|
||||||
|
|||||||
@@ -525,9 +525,10 @@ class DifyService:
|
|||||||
'inputs': {},
|
'inputs': {},
|
||||||
'query': query,
|
'query': query,
|
||||||
'response_mode': 'streaming',
|
'response_mode': 'streaming',
|
||||||
'conversation_id': normalized_conversation_id,
|
|
||||||
'user': str(user_id),
|
'user': str(user_id),
|
||||||
}
|
}
|
||||||
|
if normalized_conversation_id:
|
||||||
|
payload['conversation_id'] = normalized_conversation_id
|
||||||
if files:
|
if files:
|
||||||
payload['files'] = files
|
payload['files'] = files
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user