瀏覽代碼

fix: agent strategy missing in app model config (#1863)

tags/0.4.1
takatost 1 年之前
父節點
當前提交
82247c0f14
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 4 行新增3 行删除
  1. 4
    3
      api/core/application_manager.py

+ 4
- 3
api/core/application_manager.py 查看文件

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'] and copy_app_model_config_dict['agent_mode'][
'enabled']: 'enabled']:
agent_dict = copy_app_model_config_dict.get('agent_mode') agent_dict = copy_app_model_config_dict.get('agent_mode')
if agent_dict['strategy'] in ['router', 'react_router']:
agent_strategy = agent_dict.get('strategy', 'router')
if agent_strategy in ['router', 'react_router']:
dataset_ids = [] dataset_ids = []
for tool in agent_dict.get('tools', []): for tool in agent_dict.get('tools', []):
key = list(tool.keys())[0] key = list(tool.keys())[0]
retrieve_strategy=DatasetRetrieveConfigEntity.RetrieveStrategy.value_of( retrieve_strategy=DatasetRetrieveConfigEntity.RetrieveStrategy.value_of(
dataset_configs['retrieval_model'] dataset_configs['retrieval_model']
), ),
single_strategy=agent_dict['strategy']
single_strategy=agent_strategy
) )
) )
else: else:
) )
) )
else: else:
if agent_dict['strategy'] == 'react':
if agent_strategy == 'react':
strategy = AgentEntity.Strategy.CHAIN_OF_THOUGHT strategy = AgentEntity.Strategy.CHAIN_OF_THOUGHT
else: else:
strategy = AgentEntity.Strategy.FUNCTION_CALLING strategy = AgentEntity.Strategy.FUNCTION_CALLING

Loading…
取消
儲存