File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 44
55from dataclasses import dataclass
66from dataclasses_json import dataclass_json
7- from typing import List , Optional
7+ from typing import List , Optional , Union
88import logging , verboselogs
99
1010
@@ -26,7 +26,7 @@ class LiveOptions:
2626 diarize_version : Optional [str ] = None
2727 encoding : Optional [str ] = None
2828 endpointing : Optional [str ] = None
29- extra : Optional [str ] = None
29+ extra : Optional [Union [ list , str ] ] = None
3030 filler_words : Optional [bool ] = None
3131 interim_results : Optional [bool ] = None
3232 keywords : Optional [str ] = None
Original file line number Diff line number Diff line change @@ -75,7 +75,6 @@ class Metadata:
7575 model_info : Optional [ModelInfo ] = None
7676 model_uuid : Optional [str ] = ""
7777
78-
7978 def __getitem__ (self , key ):
8079 _dict = self .to_dict ()
8180 if _dict ["model_info" ] is not None :
@@ -147,7 +146,7 @@ class MetadataResponse:
147146 channels : Optional [int ] = 0
148147 models : Optional [List [str ]] = None
149148 model_info : Optional [Dict [str , ModelInfo ]] = None
150- extra : Optional [str ] = ""
149+ extra : Optional [Dict [ str , str ]] = None
151150
152151 def __getitem__ (self , key ):
153152 _dict = self .to_dict ()
@@ -158,6 +157,8 @@ def __getitem__(self, key):
158157 ModelInfo .from_dict (model_info )
159158 for _ , model_info in _dict ["model_info" ].items ()
160159 ]
160+ if _dict ["extra" ] is not None :
161+ _dict ["extra" ] = [str (extra ) for _ , extra in _dict ["extra" ].items ()]
161162 return _dict [key ]
162163
163164
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class PrerecordedOptions:
3131 diarize : Optional [bool ] = None
3232 diarize_version : Optional [str ] = None
3333 dictation : Optional [bool ] = None
34- extra : Optional [str ] = None
34+ extra : Optional [Union [ list , str ] ] = None
3535 filler_words : Optional [bool ] = None
3636 intents : Optional [bool ] = None
3737 keywords : Optional [Union [list , str ]] = None
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ class Metadata:
109109 topics_info : Optional [TopicsInfo ] = field (
110110 default = None , metadata = config (exclude = lambda f : f is None )
111111 )
112- extra : Optional [str ] = ""
112+ extra : Optional [Dict [ str , str ]] = None
113113
114114 def __getitem__ (self , key ):
115115 _dict = self .to_dict ()
@@ -132,6 +132,8 @@ def __getitem__(self, key):
132132 _dict ["sentiment_info" ] = SentimentInfo .from_dict (_dict ["sentiment_info" ])
133133 if _dict ["topics_info" ] is not None :
134134 _dict ["topics_info" ] = TopicsInfo .from_dict (_dict ["topics_info" ])
135+ if _dict ["extra" ] is not None :
136+ _dict ["extra" ] = [str (extra ) for _ , extra in _dict ["extra" ].items ()]
135137 return _dict [key ]
136138
137139
You can’t perform that action at this time.
0 commit comments