This commit is contained in:
takatost
2024-04-01 19:33:53 +08:00
parent 45d5d259a4
commit 8c55ff392d
10 changed files with 42 additions and 36 deletions

View File

@ -126,9 +126,18 @@ class App(db.Model):
return False
if self.app_model_config.agent_mode_dict.get('enabled', False) \
and self.app_model_config.agent_mode_dict.get('strategy', '') in ['function_call', 'react']:
self.mode = AppMode.AGENT_CHAT.value
db.session.commit()
return True
return False
@property
def mode_compatible_with_agent(self) -> str:
if self.mode == AppMode.CHAT.value and self.is_agent:
return AppMode.AGENT_CHAT.value
return self.mode
@property
def deleted_tools(self) -> list:
# get agent mode tools