sarvamai 0.1.5a6__py3-none-any.whl → 0.1.5a8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. sarvamai/__init__.py +45 -1
  2. sarvamai/chat/__init__.py +2 -0
  3. sarvamai/chat/client.py +9 -10
  4. sarvamai/chat/raw_client.py +48 -37
  5. sarvamai/client.py +13 -31
  6. sarvamai/core/__init__.py +5 -0
  7. sarvamai/core/api_error.py +13 -5
  8. sarvamai/core/client_wrapper.py +17 -20
  9. sarvamai/core/events.py +30 -0
  10. sarvamai/core/force_multipart.py +16 -0
  11. sarvamai/core/http_client.py +70 -24
  12. sarvamai/core/http_response.py +19 -11
  13. sarvamai/core/pydantic_utilities.py +69 -108
  14. sarvamai/environment.py +10 -3
  15. sarvamai/errors/__init__.py +2 -0
  16. sarvamai/errors/bad_request_error.py +4 -3
  17. sarvamai/errors/forbidden_error.py +4 -3
  18. sarvamai/errors/internal_server_error.py +4 -3
  19. sarvamai/errors/service_unavailable_error.py +4 -2
  20. sarvamai/errors/too_many_requests_error.py +4 -3
  21. sarvamai/errors/unprocessable_entity_error.py +4 -3
  22. sarvamai/requests/__init__.py +18 -0
  23. sarvamai/requests/audio_data.py +21 -0
  24. sarvamai/requests/audio_message.py +8 -0
  25. sarvamai/requests/chat_completion_request_message.py +3 -1
  26. sarvamai/requests/create_chat_completion_response.py +2 -2
  27. sarvamai/requests/diarized_transcript.py +2 -1
  28. sarvamai/requests/error_data.py +15 -0
  29. sarvamai/requests/error_details.py +0 -1
  30. sarvamai/requests/events_data.py +17 -0
  31. sarvamai/requests/language_identification_response.py +0 -1
  32. sarvamai/requests/speech_to_text_response.py +1 -2
  33. sarvamai/requests/speech_to_text_streaming_response.py +10 -0
  34. sarvamai/requests/speech_to_text_streaming_response_data.py +9 -0
  35. sarvamai/requests/speech_to_text_translate_response.py +0 -1
  36. sarvamai/requests/text_to_speech_response.py +2 -2
  37. sarvamai/requests/timestamps_model.py +2 -1
  38. sarvamai/requests/transcription_data.py +35 -0
  39. sarvamai/requests/transcription_metrics.py +15 -0
  40. sarvamai/requests/translation_response.py +0 -1
  41. sarvamai/requests/transliteration_response.py +0 -1
  42. sarvamai/speech_to_text/__init__.py +2 -0
  43. sarvamai/speech_to_text/client.py +13 -14
  44. sarvamai/speech_to_text/raw_client.py +99 -68
  45. sarvamai/speech_to_text_streaming/__init__.py +7 -0
  46. sarvamai/speech_to_text_streaming/client.py +189 -0
  47. sarvamai/speech_to_text_streaming/raw_client.py +166 -0
  48. sarvamai/speech_to_text_streaming/socket_client.py +133 -0
  49. sarvamai/speech_to_text_streaming/types/__init__.py +8 -0
  50. sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_language_code.py +8 -0
  51. sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_model.py +5 -0
  52. sarvamai/text/__init__.py +2 -0
  53. sarvamai/text/client.py +24 -25
  54. sarvamai/text/raw_client.py +126 -91
  55. sarvamai/text_to_speech/__init__.py +2 -0
  56. sarvamai/text_to_speech/client.py +10 -11
  57. sarvamai/text_to_speech/raw_client.py +49 -38
  58. sarvamai/types/__init__.py +24 -0
  59. sarvamai/types/audio_data.py +33 -0
  60. sarvamai/types/audio_data_encoding.py +5 -0
  61. sarvamai/types/audio_message.py +20 -0
  62. sarvamai/types/chat_completion_request_assistant_message.py +3 -3
  63. sarvamai/types/chat_completion_request_message.py +3 -2
  64. sarvamai/types/chat_completion_request_system_message.py +3 -3
  65. sarvamai/types/chat_completion_request_user_message.py +3 -3
  66. sarvamai/types/chat_completion_response_message.py +3 -3
  67. sarvamai/types/choice.py +4 -4
  68. sarvamai/types/completion_usage.py +3 -3
  69. sarvamai/types/create_chat_completion_response.py +3 -3
  70. sarvamai/types/diarized_entry.py +3 -3
  71. sarvamai/types/diarized_transcript.py +3 -3
  72. sarvamai/types/error_data.py +27 -0
  73. sarvamai/types/error_details.py +3 -3
  74. sarvamai/types/error_message.py +4 -4
  75. sarvamai/types/events_data.py +28 -0
  76. sarvamai/types/format.py +5 -0
  77. sarvamai/types/language_identification_response.py +2 -2
  78. sarvamai/types/speech_to_text_response.py +3 -3
  79. sarvamai/types/speech_to_text_streaming_response.py +22 -0
  80. sarvamai/types/speech_to_text_streaming_response_data.py +9 -0
  81. sarvamai/types/speech_to_text_streaming_response_type.py +5 -0
  82. sarvamai/types/speech_to_text_translate_response.py +3 -3
  83. sarvamai/types/text_to_speech_response.py +2 -2
  84. sarvamai/types/timestamps_model.py +2 -2
  85. sarvamai/types/transcription_data.py +45 -0
  86. sarvamai/types/transcription_metrics.py +27 -0
  87. sarvamai/types/translation_response.py +2 -2
  88. sarvamai/types/transliteration_response.py +2 -2
  89. sarvamai-0.1.5a8.dist-info/METADATA +28 -0
  90. sarvamai-0.1.5a8.dist-info/RECORD +134 -0
  91. sarvamai-0.1.5a6.dist-info/METADATA +0 -174
  92. sarvamai-0.1.5a6.dist-info/RECORD +0 -106
  93. {sarvamai-0.1.5a6.dist-info → sarvamai-0.1.5a8.dist-info}/WHEEL +0 -0
@@ -0,0 +1,166 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from contextlib import asynccontextmanager, contextmanager
5
+
6
+ import httpx
7
+ import websockets
8
+ import websockets.sync.client as websockets_sync_client
9
+ from ..core.api_error import ApiError
10
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
11
+ from ..core.request_options import RequestOptions
12
+ from .socket_client import AsyncSpeechToTextStreamingSocketClient, SpeechToTextStreamingSocketClient
13
+ from .types.speech_to_text_streaming_language_code import SpeechToTextStreamingLanguageCode
14
+ from .types.speech_to_text_streaming_model import SpeechToTextStreamingModel
15
+
16
+
17
+ class RawSpeechToTextStreamingClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._client_wrapper = client_wrapper
20
+
21
+ @contextmanager
22
+ def connect(
23
+ self,
24
+ *,
25
+ language_code: SpeechToTextStreamingLanguageCode,
26
+ model: SpeechToTextStreamingModel,
27
+ high_vad_sensitivity: typing.Optional[str] = None,
28
+ vad_signals: typing.Optional[str] = None,
29
+ api_subscription_key: typing.Optional[str] = None,
30
+ request_options: typing.Optional[RequestOptions] = None,
31
+ ) -> typing.Iterator[SpeechToTextStreamingSocketClient]:
32
+ """
33
+ WebSocket channel for real-time speech to text streaming
34
+
35
+ Parameters
36
+ ----------
37
+ language_code : SpeechToTextStreamingLanguageCode
38
+ Language code for speech recognition
39
+
40
+ model : SpeechToTextStreamingModel
41
+ Speech to text model to use
42
+
43
+ high_vad_sensitivity : typing.Optional[str]
44
+ Enable high VAD (Voice Activity Detection) sensitivity
45
+
46
+ vad_signals : typing.Optional[str]
47
+ Enable VAD signals in response
48
+
49
+ api_subscription_key : typing.Optional[str]
50
+ API subscription key for authentication
51
+
52
+ request_options : typing.Optional[RequestOptions]
53
+ Request-specific configuration.
54
+
55
+ Returns
56
+ -------
57
+ SpeechToTextStreamingSocketClient
58
+ """
59
+ ws_url = self._client_wrapper.get_environment().production + "/speech-to-text/ws"
60
+ query_params = httpx.QueryParams()
61
+ if language_code is not None:
62
+ query_params = query_params.add("language-code", language_code)
63
+ if model is not None:
64
+ query_params = query_params.add("model", model)
65
+ if high_vad_sensitivity is not None:
66
+ query_params = query_params.add("high_vad_sensitivity", high_vad_sensitivity)
67
+ if vad_signals is not None:
68
+ query_params = query_params.add("vad_signals", vad_signals)
69
+ ws_url = ws_url + f"?{query_params}"
70
+ headers = self._client_wrapper.get_headers()
71
+ if api_subscription_key is not None:
72
+ headers["Api-Subscription-Key"] = str(api_subscription_key)
73
+ if request_options and "additional_headers" in request_options:
74
+ headers.update(request_options["additional_headers"])
75
+ try:
76
+ with websockets_sync_client.connect(ws_url, additional_headers=headers) as protocol:
77
+ yield SpeechToTextStreamingSocketClient(websocket=protocol)
78
+ except websockets.exceptions.InvalidStatusCode as exc:
79
+ status_code: int = exc.status_code
80
+ if status_code == 401:
81
+ raise ApiError(
82
+ status_code=status_code,
83
+ headers=dict(headers),
84
+ body="Websocket initialized with invalid credentials.",
85
+ )
86
+ raise ApiError(
87
+ status_code=status_code,
88
+ headers=dict(headers),
89
+ body="Unexpected error when initializing websocket connection.",
90
+ )
91
+
92
+
93
+ class AsyncRawSpeechToTextStreamingClient:
94
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
95
+ self._client_wrapper = client_wrapper
96
+
97
+ @asynccontextmanager
98
+ async def connect(
99
+ self,
100
+ *,
101
+ language_code: SpeechToTextStreamingLanguageCode,
102
+ model: SpeechToTextStreamingModel,
103
+ high_vad_sensitivity: typing.Optional[str] = None,
104
+ vad_signals: typing.Optional[str] = None,
105
+ api_subscription_key: typing.Optional[str] = None,
106
+ request_options: typing.Optional[RequestOptions] = None,
107
+ ) -> typing.AsyncIterator[AsyncSpeechToTextStreamingSocketClient]:
108
+ """
109
+ WebSocket channel for real-time speech to text streaming
110
+
111
+ Parameters
112
+ ----------
113
+ language_code : SpeechToTextStreamingLanguageCode
114
+ Language code for speech recognition
115
+
116
+ model : SpeechToTextStreamingModel
117
+ Speech to text model to use
118
+
119
+ high_vad_sensitivity : typing.Optional[str]
120
+ Enable high VAD (Voice Activity Detection) sensitivity
121
+
122
+ vad_signals : typing.Optional[str]
123
+ Enable VAD signals in response
124
+
125
+ api_subscription_key : typing.Optional[str]
126
+ API subscription key for authentication
127
+
128
+ request_options : typing.Optional[RequestOptions]
129
+ Request-specific configuration.
130
+
131
+ Returns
132
+ -------
133
+ AsyncSpeechToTextStreamingSocketClient
134
+ """
135
+ ws_url = self._client_wrapper.get_environment().production + "/speech-to-text/ws"
136
+ query_params = httpx.QueryParams()
137
+ if language_code is not None:
138
+ query_params = query_params.add("language-code", language_code)
139
+ if model is not None:
140
+ query_params = query_params.add("model", model)
141
+ if high_vad_sensitivity is not None:
142
+ query_params = query_params.add("high_vad_sensitivity", high_vad_sensitivity)
143
+ if vad_signals is not None:
144
+ query_params = query_params.add("vad_signals", vad_signals)
145
+ ws_url = ws_url + f"?{query_params}"
146
+ headers = self._client_wrapper.get_headers()
147
+ if api_subscription_key is not None:
148
+ headers["Api-Subscription-Key"] = str(api_subscription_key)
149
+ if request_options and "additional_headers" in request_options:
150
+ headers.update(request_options["additional_headers"])
151
+ try:
152
+ async with websockets.connect(ws_url, extra_headers=headers) as protocol:
153
+ yield AsyncSpeechToTextStreamingSocketClient(websocket=protocol)
154
+ except websockets.exceptions.InvalidStatusCode as exc:
155
+ status_code: int = exc.status_code
156
+ if status_code == 401:
157
+ raise ApiError(
158
+ status_code=status_code,
159
+ headers=dict(headers),
160
+ body="Websocket initialized with invalid credentials.",
161
+ )
162
+ raise ApiError(
163
+ status_code=status_code,
164
+ headers=dict(headers),
165
+ body="Unexpected error when initializing websocket connection.",
166
+ )
@@ -0,0 +1,133 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import json
4
+ import typing
5
+
6
+ import websockets
7
+ import websockets.sync.connection as websockets_sync_connection
8
+ from ..core.events import EventEmitterMixin, EventType
9
+ from ..core.pydantic_utilities import parse_obj_as
10
+ from ..types.audio_message import AudioMessage
11
+ from ..types.speech_to_text_streaming_response import SpeechToTextStreamingResponse
12
+
13
+ SpeechToTextStreamingSocketClientResponse = typing.Union[SpeechToTextStreamingResponse]
14
+
15
+
16
+ class AsyncSpeechToTextStreamingSocketClient(EventEmitterMixin):
17
+ def __init__(self, *, websocket: websockets.WebSocketClientProtocol):
18
+ super().__init__()
19
+ self._websocket = websocket
20
+
21
+ async def __aiter__(self):
22
+ async for message in self._websocket:
23
+ yield parse_obj_as(SpeechToTextStreamingSocketClientResponse, message) # type: ignore
24
+
25
+ async def start_listening(self):
26
+ """
27
+ Start listening for messages on the websocket connection.
28
+
29
+ Emits events in the following order:
30
+ - EventType.OPEN when connection is established
31
+ - EventType.MESSAGE for each message received
32
+ - EventType.ERROR if an error occurs
33
+ - EventType.CLOSE when connection is closed
34
+ """
35
+ self._emit(EventType.OPEN, None)
36
+ try:
37
+ async for raw_message in self._websocket:
38
+ raw_message = json.loads(raw_message) if isinstance(raw_message, str) else raw_message
39
+ parsed = parse_obj_as(SpeechToTextStreamingSocketClientResponse, raw_message) # type: ignore
40
+ self._emit(EventType.MESSAGE, parsed)
41
+ except websockets.WebSocketException as exc:
42
+ self._emit(EventType.ERROR, exc)
43
+ finally:
44
+ self._emit(EventType.CLOSE, None)
45
+
46
+ async def send_audio_message(self, message: AudioMessage) -> None:
47
+ """
48
+ Send a message to the websocket connection.
49
+ The message will be sent as a AudioMessage.
50
+ """
51
+ await self._send_model(message)
52
+
53
+ async def recv(self) -> SpeechToTextStreamingSocketClientResponse:
54
+ """
55
+ Receive a message from the websocket connection.
56
+ """
57
+ data = await self._websocket.recv()
58
+ data = json.loads(data) if isinstance(data, str) else data
59
+ return parse_obj_as(SpeechToTextStreamingSocketClientResponse, data) # type: ignore
60
+
61
+ async def _send(self, data: typing.Any) -> None:
62
+ """
63
+ Send a message to the websocket connection.
64
+ """
65
+ if isinstance(data, dict):
66
+ data = json.dumps(data)
67
+ await self._websocket.send(data)
68
+
69
+ async def _send_model(self, data: typing.Any) -> None:
70
+ """
71
+ Send a Pydantic model to the websocket connection.
72
+ """
73
+ await self._send(data.dict())
74
+
75
+
76
+ class SpeechToTextStreamingSocketClient(EventEmitterMixin):
77
+ def __init__(self, *, websocket: websockets_sync_connection.Connection):
78
+ super().__init__()
79
+ self._websocket = websocket
80
+
81
+ def __iter__(self):
82
+ for message in self._websocket:
83
+ yield parse_obj_as(SpeechToTextStreamingSocketClientResponse, message) # type: ignore
84
+
85
+ def start_listening(self):
86
+ """
87
+ Start listening for messages on the websocket connection.
88
+
89
+ Emits events in the following order:
90
+ - EventType.OPEN when connection is established
91
+ - EventType.MESSAGE for each message received
92
+ - EventType.ERROR if an error occurs
93
+ - EventType.CLOSE when connection is closed
94
+ """
95
+ self._emit(EventType.OPEN, None)
96
+ try:
97
+ for raw_message in self._websocket:
98
+ raw_message = json.loads(raw_message) if isinstance(raw_message, str) else raw_message
99
+ parsed = parse_obj_as(SpeechToTextStreamingSocketClientResponse, raw_message) # type: ignore
100
+ self._emit(EventType.MESSAGE, parsed)
101
+ except websockets.WebSocketException as exc:
102
+ self._emit(EventType.ERROR, exc)
103
+ finally:
104
+ self._emit(EventType.CLOSE, None)
105
+
106
+ def send_audio_message(self, message: AudioMessage) -> None:
107
+ """
108
+ Send a message to the websocket connection.
109
+ The message will be sent as a AudioMessage.
110
+ """
111
+ self._send_model(message)
112
+
113
+ def recv(self) -> SpeechToTextStreamingSocketClientResponse:
114
+ """
115
+ Receive a message from the websocket connection.
116
+ """
117
+ data = self._websocket.recv()
118
+ data = json.loads(data) if isinstance(data, str) else data
119
+ return parse_obj_as(SpeechToTextStreamingSocketClientResponse, data) # type: ignore
120
+
121
+ def _send(self, data: typing.Any) -> None:
122
+ """
123
+ Send a message to the websocket connection.
124
+ """
125
+ if isinstance(data, dict):
126
+ data = json.dumps(data)
127
+ self._websocket.send(data)
128
+
129
+ def _send_model(self, data: typing.Any) -> None:
130
+ """
131
+ Send a Pydantic model to the websocket connection.
132
+ """
133
+ self._send(data.dict())
@@ -0,0 +1,8 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .speech_to_text_streaming_language_code import SpeechToTextStreamingLanguageCode
6
+ from .speech_to_text_streaming_model import SpeechToTextStreamingModel
7
+
8
+ __all__ = ["SpeechToTextStreamingLanguageCode", "SpeechToTextStreamingModel"]
@@ -0,0 +1,8 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ SpeechToTextStreamingLanguageCode = typing.Union[
6
+ typing.Literal["en-IN", "hi-IN", "bn-IN", "gu-IN", "kn-IN", "ml-IN", "mr-IN", "od-IN", "pa-IN", "ta-IN", "te-IN"],
7
+ typing.Any,
8
+ ]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ SpeechToTextStreamingModel = typing.Union[typing.Literal["saarika:v2.5", "saarika:v2"], typing.Any]
sarvamai/text/__init__.py CHANGED
@@ -1,2 +1,4 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ # isort: skip_file
4
+
sarvamai/text/client.py CHANGED
@@ -1,24 +1,23 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
4
- from ..core.client_wrapper import SyncClientWrapper
5
- from .raw_client import RawTextClient
6
- from ..types.translate_source_language import TranslateSourceLanguage
7
- from ..types.translate_target_language import TranslateTargetLanguage
8
- from ..types.translate_speaker_gender import TranslateSpeakerGender
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ..core.request_options import RequestOptions
7
+ from ..types.language_identification_response import LanguageIdentificationResponse
8
+ from ..types.numerals_format import NumeralsFormat
9
+ from ..types.spoken_form_numerals_format import SpokenFormNumeralsFormat
9
10
  from ..types.translate_mode import TranslateMode
10
11
  from ..types.translate_model import TranslateModel
11
- from ..types.transliterate_mode import TransliterateMode
12
- from ..types.numerals_format import NumeralsFormat
13
- from ..core.request_options import RequestOptions
12
+ from ..types.translate_source_language import TranslateSourceLanguage
13
+ from ..types.translate_speaker_gender import TranslateSpeakerGender
14
+ from ..types.translate_target_language import TranslateTargetLanguage
14
15
  from ..types.translation_response import TranslationResponse
15
- from ..types.language_identification_response import LanguageIdentificationResponse
16
- from ..types.transliterate_source_language import TransliterateSourceLanguage
17
16
  from ..types.translatiterate_target_language import TranslatiterateTargetLanguage
18
- from ..types.spoken_form_numerals_format import SpokenFormNumeralsFormat
17
+ from ..types.transliterate_mode import TransliterateMode
18
+ from ..types.transliterate_source_language import TransliterateSourceLanguage
19
19
  from ..types.transliteration_response import TransliterationResponse
20
- from ..core.client_wrapper import AsyncClientWrapper
21
- from .raw_client import AsyncRawTextClient
20
+ from .raw_client import AsyncRawTextClient, RawTextClient
22
21
 
23
22
  # this is used as the default value for optional parameters
24
23
  OMIT = typing.cast(typing.Any, ...)
@@ -180,7 +179,7 @@ class TextClient:
180
179
  target_language_code="bn-IN",
181
180
  )
182
181
  """
183
- response = self._raw_client.translate(
182
+ _response = self._raw_client.translate(
184
183
  input=input,
185
184
  source_language_code=source_language_code,
186
185
  target_language_code=target_language_code,
@@ -192,7 +191,7 @@ class TextClient:
192
191
  numerals_format=numerals_format,
193
192
  request_options=request_options,
194
193
  )
195
- return response.data
194
+ return _response.data
196
195
 
197
196
  def identify_language(
198
197
  self, *, input: str, request_options: typing.Optional[RequestOptions] = None
@@ -224,8 +223,8 @@ class TextClient:
224
223
  input="input",
225
224
  )
226
225
  """
227
- response = self._raw_client.identify_language(input=input, request_options=request_options)
228
- return response.data
226
+ _response = self._raw_client.identify_language(input=input, request_options=request_options)
227
+ return _response.data
229
228
 
230
229
  def transliterate(
231
230
  self,
@@ -336,7 +335,7 @@ class TextClient:
336
335
  target_language_code="bn-IN",
337
336
  )
338
337
  """
339
- response = self._raw_client.transliterate(
338
+ _response = self._raw_client.transliterate(
340
339
  input=input,
341
340
  source_language_code=source_language_code,
342
341
  target_language_code=target_language_code,
@@ -345,7 +344,7 @@ class TextClient:
345
344
  spoken_form=spoken_form,
346
345
  request_options=request_options,
347
346
  )
348
- return response.data
347
+ return _response.data
349
348
 
350
349
 
351
350
  class AsyncTextClient:
@@ -512,7 +511,7 @@ class AsyncTextClient:
512
511
 
513
512
  asyncio.run(main())
514
513
  """
515
- response = await self._raw_client.translate(
514
+ _response = await self._raw_client.translate(
516
515
  input=input,
517
516
  source_language_code=source_language_code,
518
517
  target_language_code=target_language_code,
@@ -524,7 +523,7 @@ class AsyncTextClient:
524
523
  numerals_format=numerals_format,
525
524
  request_options=request_options,
526
525
  )
527
- return response.data
526
+ return _response.data
528
527
 
529
528
  async def identify_language(
530
529
  self, *, input: str, request_options: typing.Optional[RequestOptions] = None
@@ -564,8 +563,8 @@ class AsyncTextClient:
564
563
 
565
564
  asyncio.run(main())
566
565
  """
567
- response = await self._raw_client.identify_language(input=input, request_options=request_options)
568
- return response.data
566
+ _response = await self._raw_client.identify_language(input=input, request_options=request_options)
567
+ return _response.data
569
568
 
570
569
  async def transliterate(
571
570
  self,
@@ -684,7 +683,7 @@ class AsyncTextClient:
684
683
 
685
684
  asyncio.run(main())
686
685
  """
687
- response = await self._raw_client.transliterate(
686
+ _response = await self._raw_client.transliterate(
688
687
  input=input,
689
688
  source_language_code=source_language_code,
690
689
  target_language_code=target_language_code,
@@ -693,4 +692,4 @@ class AsyncTextClient:
693
692
  spoken_form=spoken_form,
694
693
  request_options=request_options,
695
694
  )
696
- return response.data
695
+ return _response.data