Unverified Commit 82247c0f authored by takatost's avatar takatost Committed by GitHub

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

parent d70d61b1
...@@ -376,7 +376,8 @@ class ApplicationManager: ...@@ -376,7 +376,8 @@ class ApplicationManager:
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]
...@@ -402,7 +403,7 @@ class ApplicationManager: ...@@ -402,7 +403,7 @@ class ApplicationManager:
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:
...@@ -419,7 +420,7 @@ class ApplicationManager: ...@@ -419,7 +420,7 @@ class ApplicationManager:
) )
) )
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment