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

This commit is contained in:
wdeveloper16
2026-04-14 03:03:08 +00:00
committed by GitHub
parent 2f682780fa
commit eeebedcfe8
14 changed files with 26 additions and 19 deletions
+2 -2
View File
@@ -174,8 +174,8 @@ class RetrievalService:
cls,
dataset_id: str,
query: str,
external_retrieval_model: dict | None = None,
metadata_filtering_conditions: dict | None = None,
external_retrieval_model: dict[str, Any] | None = None,
metadata_filtering_conditions: dict[str, Any] | None = None,
):
stmt = select(Dataset).where(Dataset.id == dataset_id)
dataset = db.session.scalar(stmt)
+1 -1
View File
@@ -232,7 +232,7 @@ class CacheEmbedding(Embeddings):
return embedding_results # type: ignore
def embed_multimodal_query(self, multimodel_document: dict) -> list[float]:
def embed_multimodal_query(self, multimodel_document: dict[str, Any]) -> list[float]:
"""Embed multimodal documents."""
# use doc embedding cache or store if not exists
file_id = multimodel_document["file_id"]
+2 -1
View File
@@ -1,4 +1,5 @@
from abc import ABC, abstractmethod
from typing import Any
class Embeddings(ABC):
@@ -20,7 +21,7 @@ class Embeddings(ABC):
raise NotImplementedError
@abstractmethod
def embed_multimodal_query(self, multimodel_document: dict) -> list[float]:
def embed_multimodal_query(self, multimodel_document: dict[str, Any]) -> list[float]:
"""Embed multimodal query."""
raise NotImplementedError