Skip to content

refactor: replace bare dict with dict[str, Any] in core provider services and misc modules#35124

Merged
crazywoola merged 1 commit intolanggenius:mainfrom
wdeveloper16:refactor/typed-dict-core-provider-services
Apr 14, 2026
Merged

refactor: replace bare dict with dict[str, Any] in core provider services and misc modules#35124
crazywoola merged 1 commit intolanggenius:mainfrom
wdeveloper16:refactor/typed-dict-core-provider-services

Conversation

@wdeveloper16
Copy link
Copy Markdown
Contributor

Replace bare dict with dict[str, Any] across core/provider_manager.py, core/model_manager.py, core/entities/provider_entities.py, core/external_data_tool/factory.py, core/telemetry/gateway.py, core/prompt/simple_prompt_transform.py, core/rag/embedding/ (cached + base), core/rag/datasource/retrieval_service.py, services/app_model_config_service.py, services/auth/api_key_auth_service.py, services/tools/tools_transform_service.py, configs/middleware/vdb/iris_config.py, and extensions/storage/clickzetta_volume/clickzetta_volume_storage.py.

Add from typing import Any where missing.

Part of #22651.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. refactor labels Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-14 01:53:59.638566467 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-14 01:53:48.914585911 +0000
@@ -118,6 +118,10 @@
    --> core/rag/index_processor/processor/qa_index_processor.py:209:16
 ERROR No matching overload found for function `core.model_manager.ModelInstance.invoke_llm` called with arguments: (prompt_messages=list[SystemPromptMessage | UserPromptMessage], tools=list[PromptMessageTool], stream=Literal[False], model_parameters=dict[str, float | int]) [no-matching-overload]
   --> core/rag/retrieval/router/multi_dataset_function_call_router.py:32:58
+ERROR Returned type `dict[TelemetryCase, CaseRoute]` is not assignable to declared return type `dict[str, Any]` [bad-return]
+  --> core/telemetry/gateway.py:95:16
+ERROR Returned type `dict[TelemetryCase, TraceTaskName]` is not assignable to declared return type `dict[str, Any]` [bad-return]
+  --> core/telemetry/gateway.py:97:16
 ERROR Class member `MCPToolProviderController.entity` overrides parent class `ToolProviderController` in an inconsistent manner [bad-override]
   --> core/tools/mcp_tool/provider.py:33:14
 ERROR Class member `PluginToolProviderController.entity` overrides parent class `BuiltinToolProviderController` in an inconsistent manner [bad-override]

@wdeveloper16 wdeveloper16 force-pushed the refactor/typed-dict-core-provider-services branch from 94c2efe to 65f3a1b Compare April 14, 2026 02:04
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

No changes detected.

Copy link
Copy Markdown
Member

@crazywoola crazywoola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required checks are green and these type annotation tighten-ups look good to merge.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 14, 2026
@crazywoola crazywoola added this pull request to the merge queue Apr 14, 2026
Merged via the queue into langgenius:main with commit eeebedc Apr 14, 2026
28 checks passed
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants