|
@@ -196,6 +196,7 @@ class AppService:
|
|
|
app.api_rph = args.get("api_rph", 0)
|
|
|
app.api_rpm = args.get("api_rpm", 0)
|
|
|
app.created_by = account.id
|
|
|
+ app.dept_id =account.dept_id
|
|
|
app.updated_by = account.id
|
|
|
|
|
|
db.session.add(app)
|
|
@@ -218,8 +219,10 @@ class AppService:
|
|
|
return app
|
|
|
|
|
|
def get_app_by_id(self, app: App) -> App:
|
|
|
+
|
|
|
return app
|
|
|
|
|
|
+
|
|
|
def get_app(self, app: App) -> App:
|
|
|
"""
|
|
|
Get App
|
|
@@ -247,7 +250,6 @@ class AppService:
|
|
|
provider_type=agent_tool_entity.provider_type,
|
|
|
identity_id=f"AGENT.{app.id}",
|
|
|
)
|
|
|
-
|
|
|
# get decrypted parameters
|
|
|
if agent_tool_entity.tool_parameters:
|
|
|
parameters = manager.decrypt_tool_parameters(agent_tool_entity.tool_parameters or {})
|
|
@@ -262,12 +264,10 @@ class AppService:
|
|
|
|
|
|
# override agent mode
|
|
|
model_config.agent_mode = json.dumps(agent_mode)
|
|
|
-
|
|
|
class ModifiedApp(App):
|
|
|
"""
|
|
|
Modified App class
|
|
|
"""
|
|
|
-
|
|
|
def __init__(self, app):
|
|
|
self.__dict__.update(app.__dict__)
|
|
|
|
|
@@ -276,7 +276,6 @@ class AppService:
|
|
|
return model_config
|
|
|
|
|
|
app = ModifiedApp(app)
|
|
|
-
|
|
|
return app
|
|
|
|
|
|
def update_app(self, app: App, args: dict) -> App:
|
|
@@ -449,6 +448,7 @@ class AppService:
|
|
|
app.edit_auth = edit_auth
|
|
|
app.updated_by = current_user.id
|
|
|
app.updated_at = datetime.now(UTC).replace(tzinfo=None)
|
|
|
+
|
|
|
db.session.commit()
|
|
|
|
|
|
return app
|