Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Chore: remove dead func AppModelConfig.copy() with wrong logic (#24747)

Yongtao Huang837c0ddacc7c
diff --git a/api/models/model.py b/api/models/model.py
index ed1be14a6c7..53646c01551 100644
--- a/api/models/model.py
+++ b/api/models/model.py
@@ -522,33 +522,6 @@ class AppModelConfig(Base):
self.file_upload = json.dumps(model_config.get("file_upload")) if model_config.get("file_upload") else None
return self
- def copy(self):
- new_app_model_config = AppModelConfig(
- id=self.id,
- app_id=self.app_id,
- opening_statement=self.opening_statement,
- suggested_questions=self.suggested_questions,
- suggested_questions_after_answer=self.suggested_questions_after_answer,
- speech_to_text=self.speech_to_text,
- text_to_speech=self.text_to_speech,
- more_like_this=self.more_like_this,
- sensitive_word_avoidance=self.sensitive_word_avoidance,
- external_data_tools=self.external_data_tools,
- model=self.model,
- user_input_form=self.user_input_form,
- dataset_query_variable=self.dataset_query_variable,
- pre_prompt=self.pre_prompt,
- agent_mode=self.agent_mode,
- retriever_resource=self.retriever_resource,
- prompt_type=self.prompt_type,
- chat_prompt_config=self.chat_prompt_config,
- completion_prompt_config=self.completion_prompt_config,
- dataset_configs=self.dataset_configs,
- file_upload=self.file_upload,
- )
-
- return new_app_model_config
-
class RecommendedApp(Base):
__tablename__ = "recommended_apps"
diff --git a/api/services/app_generate_service.py b/api/services/app_generate_service.py
index 6792324ec8c..3861764f12f 100644
--- a/api/services/app_generate_service.py
+++ b/api/services/app_generate_service.py
@@ -55,7 +55,7 @@ class AppGenerateService:
cls.system_rate_limiter.increment_rate_limit(app_model.tenant_id)
# app level rate limiter
- max_active_request = AppGenerateService._get_max_active_requests(app_model)
+ max_active_request = cls._get_max_active_requests(app_model)
rate_limit = RateLimit(app_model.id, max_active_request)
request_id = RateLimit.gen_request_key()
try: