deepgram.clients.common.v1.websocket_response

 1# Copyright 2024 Deepgram SDK contributors. All Rights Reserved.
 2# Use of this source code is governed by a MIT license that can be found in the LICENSE file.
 3# SPDX-License-Identifier: MIT
 4
 5from typing import List, Optional, Dict, Any
 6
 7from dataclasses import dataclass, field
 8from dataclasses_json import config as dataclass_config
 9
10from .shared_response import BaseResponse
11
12
13# Result Message
14
15
16@dataclass
17class OpenResponse(BaseResponse):
18    """
19    Open Message from the Deepgram Platform
20    """
21
22    type: str = ""
23
24
25# Close Message
26
27
28@dataclass
29class CloseResponse(BaseResponse):
30    """
31    Close Message from the Deepgram Platform
32    """
33
34    type: str = ""
35
36
37# Error Message
38
39
40@dataclass
41class ErrorResponse(BaseResponse):
42    """
43    Error Message from the Deepgram Platform
44    """
45
46    description: str = ""
47    message: str = ""
48    type: str = ""
49    variant: Optional[str] = field(
50        default=None, metadata=dataclass_config(exclude=lambda f: f is None)
51    )
52
53
54# Unhandled Message
55
56
57@dataclass
58class UnhandledResponse(BaseResponse):
59    """
60    Unhandled Message from the Deepgram Platform
61    """
62
63    type: str = ""
64    raw: str = ""
@dataclass
class OpenResponse(deepgram.clients.common.v1.shared_response.BaseResponse):
17@dataclass
18class OpenResponse(BaseResponse):
19    """
20    Open Message from the Deepgram Platform
21    """
22
23    type: str = ""

Open Message from the Deepgram Platform

OpenResponse(type: str = '')
type: str = ''
@dataclass
class CloseResponse(deepgram.clients.common.v1.shared_response.BaseResponse):
29@dataclass
30class CloseResponse(BaseResponse):
31    """
32    Close Message from the Deepgram Platform
33    """
34
35    type: str = ""

Close Message from the Deepgram Platform

CloseResponse(type: str = '')
type: str = ''
@dataclass
class ErrorResponse(deepgram.clients.common.v1.shared_response.BaseResponse):
41@dataclass
42class ErrorResponse(BaseResponse):
43    """
44    Error Message from the Deepgram Platform
45    """
46
47    description: str = ""
48    message: str = ""
49    type: str = ""
50    variant: Optional[str] = field(
51        default=None, metadata=dataclass_config(exclude=lambda f: f is None)
52    )

Error Message from the Deepgram Platform

ErrorResponse( description: str = '', message: str = '', type: str = '', variant: Optional[str] = None)
description: str = ''
message: str = ''
type: str = ''
variant: Optional[str] = None
@dataclass
class UnhandledResponse(deepgram.clients.common.v1.shared_response.BaseResponse):
58@dataclass
59class UnhandledResponse(BaseResponse):
60    """
61    Unhandled Message from the Deepgram Platform
62    """
63
64    type: str = ""
65    raw: str = ""

Unhandled Message from the Deepgram Platform

UnhandledResponse(type: str = '', raw: str = '')
type: str = ''
raw: str = ''