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.

refactor: type remaining bare dict annotations (#37422)

y06d9b01a8d1d
diff --git a/api/core/app/apps/chat/app_config_manager.py b/api/core/app/apps/chat/app_config_manager.py
index 5f087f60663..35507d65ab9 100644
--- a/api/core/app/apps/chat/app_config_manager.py
+++ b/api/core/app/apps/chat/app_config_manager.py
@@ -81,7 +81,7 @@ class ChatAppConfigManager(BaseAppConfigManager):
return app_config
@classmethod
- def config_validate(cls, tenant_id: str, config: dict) -> AppModelConfigDict:
+ def config_validate(cls, tenant_id: str, config: dict[str, Any]) -> AppModelConfigDict:
"""
Validate for chat app model config
diff --git a/api/core/app/apps/completion/app_config_manager.py b/api/core/app/apps/completion/app_config_manager.py
index f49e7b8b5e2..fcfb38e8c80 100644
--- a/api/core/app/apps/completion/app_config_manager.py
+++ b/api/core/app/apps/completion/app_config_manager.py
@@ -68,7 +68,7 @@ class CompletionAppConfigManager(BaseAppConfigManager):
return app_config
@classmethod
- def config_validate(cls, tenant_id: str, config: dict) -> AppModelConfigDict:
+ def config_validate(cls, tenant_id: str, config: dict[str, Any]) -> AppModelConfigDict:
"""
Validate for completion app model config
diff --git a/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_service.py b/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_service.py
index 6283dbb986b..ca9494e53fb 100644
--- a/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_service.py
+++ b/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_service.py
@@ -1,7 +1,8 @@
import logging
import time
import uuid
-from collections.abc import Sequence
+from collections.abc import Mapping, Sequence
+from typing import Any
import httpx
from httpx import DigestAuth
@@ -24,7 +25,7 @@ _tidb_http_client: httpx.Client = get_pooled_http_client(
class TidbService:
@staticmethod
- def extract_qdrant_endpoint(cluster_response: dict) -> str | None:
+ def extract_qdrant_endpoint(cluster_response: Mapping[str, Any]) -> str | None:
"""Extract the qdrant endpoint URL from a Get Cluster API response.
Reads ``endpoints.public.host`` (e.g. ``gateway01.xx.tidbcloud.com``),