mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-11 20:06:54 +08:00
fix: agent strategy (#2141)
This commit is contained in:
@@ -419,8 +419,9 @@ class ApplicationManager:
|
|||||||
datasets = {'strategy': 'router', 'datasets': []}
|
datasets = {'strategy': 'router', 'datasets': []}
|
||||||
|
|
||||||
if 'agent_mode' in copy_app_model_config_dict and copy_app_model_config_dict['agent_mode'] \
|
if 'agent_mode' in copy_app_model_config_dict and copy_app_model_config_dict['agent_mode'] \
|
||||||
and 'enabled' in copy_app_model_config_dict['agent_mode'] and copy_app_model_config_dict['agent_mode'][
|
and 'enabled' in copy_app_model_config_dict['agent_mode'] \
|
||||||
'enabled']:
|
and copy_app_model_config_dict['agent_mode']['enabled']:
|
||||||
|
|
||||||
agent_dict = copy_app_model_config_dict.get('agent_mode', {})
|
agent_dict = copy_app_model_config_dict.get('agent_mode', {})
|
||||||
agent_strategy = agent_dict.get('strategy', 'cot')
|
agent_strategy = agent_dict.get('strategy', 'cot')
|
||||||
|
|
||||||
@@ -465,6 +466,8 @@ class ApplicationManager:
|
|||||||
dataset_id = tool_item['id']
|
dataset_id = tool_item['id']
|
||||||
dataset_ids.append(dataset_id)
|
dataset_ids.append(dataset_id)
|
||||||
|
|
||||||
|
if 'strategy' in copy_app_model_config_dict['agent_mode'] and \
|
||||||
|
copy_app_model_config_dict['agent_mode']['strategy'] not in ['react_router', 'router']:
|
||||||
agent_prompt = agent_dict.get('prompt', None) or {}
|
agent_prompt = agent_dict.get('prompt', None) or {}
|
||||||
# check model mode
|
# check model mode
|
||||||
model_mode = copy_app_model_config_dict.get('model', {}).get('mode', 'completion')
|
model_mode = copy_app_model_config_dict.get('model', {}).get('mode', 'completion')
|
||||||
|
|||||||
Reference in New Issue
Block a user