Skip to content

Commit

Permalink
fix SearchedMultimodalDoc in docarray (#583)
Browse files Browse the repository at this point in the history
Signed-off-by: BaoHuiling <[email protected]>
  • Loading branch information
BaoHuiling authored Aug 30, 2024
1 parent 0d49244 commit ed44b44
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions comps/cores/proto/docarray.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit ed44b44

Please sign in to comment.