Skip to content

Commit f7f8eef

Browse files
author
MayaCrmi
committed
changed types
1 parent 0be154d commit f7f8eef

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

multi-agent/elements/retrievers/docs_dataflow/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Literal, Optional, List, Union
1+
from typing import Dict, List, Literal, Optional
22
from pydantic import Field
33
from elements.retrievers.common.base_config import BaseRetrieverConfig
44
from core.field_hints import ActionHint, HintType, SelectionType
@@ -31,7 +31,7 @@ class DocsDataflowRetrieverConfig(BaseRetrieverConfig):
3131
description="Request timeout in seconds"
3232
)
3333

34-
docs: Optional[List[Union[dict, str]]] = Field(
34+
docs: Optional[List[Dict]] = Field(
3535
default=None,
3636
description="Filter results to specific documents",
3737
json_schema_extra=ActionHint(

multi-agent/elements/retrievers/docs_dataflow/docs_dataflow_retriever.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Optional, Union
1+
from typing import Dict, List, Optional
22
from elements.retrievers.common.base_retriever import BaseRetriever
33
from elements.providers.dataflow_client.config import DataflowProviderConfig
44
from elements.providers.dataflow_client.dataflow_provider_factory import DataflowProviderFactory
@@ -15,7 +15,7 @@ def __init__(
1515
top_k_results: int,
1616
threshold: float,
1717
timeout: float = 30.0,
18-
docs: Optional[List[Union[dict, str]]] = None,
18+
docs: Optional[List[Dict]] = None,
1919
tags: Optional[List[str]] = None,
2020
):
2121
self.threshold = threshold
@@ -31,8 +31,8 @@ def __init__(
3131
def retrieve(self, query: str) -> List[dict]:
3232
context = get_current_context()
3333

34-
# Extract document IDs from docs list (handles both dict and string items)
35-
doc_ids = [doc.get('id') if isinstance(doc, dict) else doc for doc in (self.docs or [])] or None
34+
# Extract document IDs from docs list
35+
doc_ids = [doc['id'] for doc in self.docs] if self.docs else None
3636

3737
response = self._provider.query(
3838
query=query,

0 commit comments

Comments
 (0)