refactor apps

This commit is contained in:
takatost
2024-03-02 02:40:18 +08:00
parent 5e38996222
commit 5c7ea08bdf
111 changed files with 1979 additions and 1819 deletions

View File

@ -105,6 +105,18 @@ class App(db.Model):
tenant = db.session.query(Tenant).filter(Tenant.id == self.tenant_id).first()
return tenant
@property
def is_agent(self) -> bool:
app_model_config = self.app_model_config
if not app_model_config:
return False
if not app_model_config.agent_mode:
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']:
return True
return False
@property
def deleted_tools(self) -> list:
# get agent mode tools