| @@ -127,7 +127,9 @@ class AdvancedChatAppGenerator(MessageBasedAppGenerator): | |||
| conversation_id=conversation.id if conversation else None, | |||
| inputs=conversation.inputs | |||
| if conversation | |||
| else self._prepare_user_inputs(user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.id), | |||
| else self._prepare_user_inputs( | |||
| user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.tenant_id | |||
| ), | |||
| query=query, | |||
| files=file_objs, | |||
| parent_message_id=args.get("parent_message_id") if invoke_from != InvokeFrom.SERVICE_API else UUID_NIL, | |||
| @@ -134,7 +134,9 @@ class AgentChatAppGenerator(MessageBasedAppGenerator): | |||
| conversation_id=conversation.id if conversation else None, | |||
| inputs=conversation.inputs | |||
| if conversation | |||
| else self._prepare_user_inputs(user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.id), | |||
| else self._prepare_user_inputs( | |||
| user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.tenant_id | |||
| ), | |||
| query=query, | |||
| files=file_objs, | |||
| parent_message_id=args.get("parent_message_id") if invoke_from != InvokeFrom.SERVICE_API else UUID_NIL, | |||
| @@ -132,7 +132,9 @@ class ChatAppGenerator(MessageBasedAppGenerator): | |||
| conversation_id=conversation.id if conversation else None, | |||
| inputs=conversation.inputs | |||
| if conversation | |||
| else self._prepare_user_inputs(user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.id), | |||
| else self._prepare_user_inputs( | |||
| user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.tenant_id | |||
| ), | |||
| query=query, | |||
| files=file_objs, | |||
| parent_message_id=args.get("parent_message_id") if invoke_from != InvokeFrom.SERVICE_API else UUID_NIL, | |||
| @@ -114,7 +114,7 @@ class CompletionAppGenerator(MessageBasedAppGenerator): | |||
| model_conf=ModelConfigConverter.convert(app_config), | |||
| file_upload_config=file_extra_config, | |||
| inputs=self._prepare_user_inputs( | |||
| user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.id | |||
| user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.tenant_id | |||
| ), | |||
| query=query, | |||
| files=file_objs, | |||
| @@ -56,8 +56,8 @@ class Account(UserMixin, db.Model): | |||
| self._current_tenant = tenant | |||
| @property | |||
| def current_tenant_id(self): | |||
| return self._current_tenant.id | |||
| def current_tenant_id(self) -> str | None: | |||
| return self._current_tenant.id if self._current_tenant else None | |||
| @current_tenant_id.setter | |||
| def current_tenant_id(self, value: str): | |||