22
33import numpy as np
44
5+ from pydantic import Field
6+
57from docarray .base_doc import BaseDoc
68from docarray .typing import AnyEmbedding , AudioUrl
79from docarray .typing .bytes .audio_bytes import AudioBytes
@@ -94,11 +96,29 @@ class MultiModalDoc(BaseDoc):
9496 ```
9597 """
9698
97- url : Optional [AudioUrl ] = None
98- tensor : Optional [AudioTensor ] = None
99- embedding : Optional [AnyEmbedding ] = None
100- bytes_ : Optional [AudioBytes ] = None
101- frame_rate : Optional [int ] = None
99+ url : Optional [AudioUrl ] = Field (
100+ description = 'The url to a (potentially remote) audio file that can be loaded' ,
101+ example = 'https://github.com/docarray/docarray/blob/main/tests/toydata/hello.mp3?raw=true' ,
102+ default = None ,
103+ )
104+ tensor : Optional [AudioTensor ] = Field (
105+ description = 'Tensor object of the audio which can be specified to one of `AudioNdArray`, `AudioTorchTensor`, `AudioTensorFlowTensor`' ,
106+ default = None ,
107+ )
108+ embedding : Optional [AnyEmbedding ] = Field (
109+ description = 'Store an embedding: a vector representation of the audio.' ,
110+ example = [0 , 1 , 0 ],
111+ default = None ,
112+ )
113+ bytes_ : Optional [AudioBytes ] = Field (
114+ description = 'Bytes representation pf the audio' ,
115+ default = None ,
116+ )
117+ frame_rate : Optional [int ] = Field (
118+ description = 'An integer representing the frame rate of the audio.' ,
119+ example = 24 ,
120+ default = None ,
121+ )
102122
103123 @classmethod
104124 def validate (
0 commit comments