From caf02dbf2028573aba1a4def8513e55f461ba491 Mon Sep 17 00:00:00 2001 From: David vonThenen <12752197+dvonthenen@users.noreply.github.com> Date: Wed, 3 Jul 2024 12:45:53 -0700 Subject: [PATCH] Fix `endpointing` attribute in `LiveOptions` --- deepgram/clients/listen/v1/websocket/options.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deepgram/clients/listen/v1/websocket/options.py b/deepgram/clients/listen/v1/websocket/options.py index abebc924..667605dc 100644 --- a/deepgram/clients/listen/v1/websocket/options.py +++ b/deepgram/clients/listen/v1/websocket/options.py @@ -41,9 +41,15 @@ class LiveOptions(DataClassJsonMixin): # pylint: disable=too-many-instance-attr encoding: Optional[str] = field( default=None, metadata=dataclass_config(exclude=lambda f: f is None) ) - endpointing: Optional[str] = field( + # pylint: disable=W0511 + # TODO: endpointing's current type previous was `Optional[str]` which is incorrect + # for backward compatibility we are keeping it as `Optional[Union[str, bool, int]]` + # since it gets translated to a string to be placed as a query parameter, will keep `str` for now + # but will change this to `Optional[Union[bool, int]]` in a future release + endpointing: Optional[Union[str, bool, int]] = field( default=None, metadata=dataclass_config(exclude=lambda f: f is None) ) + # pylint: enable=W0511 extra: Optional[Union[List[str], str]] = field( default=None, metadata=dataclass_config(exclude=lambda f: f is None) )