diff --git a/comps/cores/proto/docarray.py b/comps/cores/proto/docarray.py index e9716209d..1a29aa329 100644 --- a/comps/cores/proto/docarray.py +++ b/comps/cores/proto/docarray.py @@ -1,11 +1,11 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -from typing import Dict, List, Optional, Tuple, Union +from typing import Any, Dict, List, Optional, Union import numpy as np from docarray import BaseDoc, DocList -from docarray.documents import AudioDoc, VideoDoc +from docarray.documents import AudioDoc from docarray.typing import AudioUrl, ImageUrl from pydantic import Field, conint, conlist, field_validator @@ -43,14 +43,6 @@ class TextImageDoc(BaseDoc): ] -class ImageDoc(BaseDoc): - image_path: str - - -class TextImageDoc(BaseDoc): - doc: Tuple[Union[TextDoc, ImageDoc]] - - class Base64ByteStrDoc(BaseDoc): byte_str: str @@ -110,14 +102,8 @@ class Config: json_encoders = {np.ndarray: lambda x: x.tolist()} -class SearchedMultimodalDoc(BaseDoc): - retrieved_docs: List[TextImageDoc] - initial_query: str - top_n: int = 1 - metadata: Optional[List[Dict]] = None - - class Config: - json_encoders = {np.ndarray: lambda x: x.tolist()} +class SearchedMultimodalDoc(SearchedDoc): + metadata: List[Dict[str, Any]] class GeneratedDoc(BaseDoc):