Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

Commit e981291

Browse files
committed
docs: adding field descriptions to predefined video document
Signed-off-by: punndcoder28 <puneethk.2899@gmail.com>
1 parent 715252a commit e981291

1 file changed

Lines changed: 29 additions & 6 deletions

File tree

‎docarray/documents/video.py‎

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import numpy as np
44

5+
from pydantic import Field
6+
57
from docarray.base_doc import BaseDoc
68
from docarray.documents import AudioDoc
79
from docarray.typing import AnyEmbedding, AnyTensor, VideoBytes
@@ -97,12 +99,33 @@ class MultiModalDoc(BaseDoc):
9799
```
98100
"""
99101

100-
url: Optional[VideoUrl] = None
101-
audio: Optional[AudioDoc] = AudioDoc()
102-
tensor: Optional[VideoTensor] = None
103-
key_frame_indices: Optional[AnyTensor] = None
104-
embedding: Optional[AnyEmbedding] = None
105-
bytes_: Optional[VideoBytes] = None
102+
url: Optional[VideoUrl] = Field(
103+
description='URL to a (potentially remote) video file that needs to be loaded',
104+
example='https://github.com/docarray/docarray/blob/main/tests/toydata/mov_bbb.mp4?raw=true',
105+
default=None,
106+
)
107+
audio: Optional[AudioDoc] = Field(
108+
description='Audio document document associated with the video',
109+
default=None,
110+
)
111+
tensor: Optional[VideoTensor] = Field(
112+
description='Tensor object representing the video which be specified to one of `VideoNdArray`, `VideoTorchTensor`, `VideoTensorFlowTensor`',
113+
default=None,
114+
)
115+
key_frame_indices: Optional[AnyTensor] = Field(
116+
description='List of all the key frames in the video',
117+
example=[0, 1, 2, 3, 4],
118+
default=None,
119+
)
120+
embedding: Optional[AnyEmbedding] = Field(
121+
description='Store an embedding: a vector representation of the video',
122+
example=[1, 0, 1],
123+
default=None,
124+
)
125+
bytes_: Optional[VideoBytes] = Field(
126+
description='Bytes representation of the video',
127+
default=None,
128+
)
106129

107130
@classmethod
108131
def validate(

0 commit comments

Comments
 (0)