sarvamai 0.1.5a5__py3-none-any.whl → 0.1.5a6__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 +1 -45
  2. sarvamai/chat/__init__.py +0 -2
  3. sarvamai/chat/client.py +10 -9
  4. sarvamai/chat/raw_client.py +37 -48
  5. sarvamai/client.py +31 -13
  6. sarvamai/core/__init__.py +0 -5
  7. sarvamai/core/api_error.py +5 -13
  8. sarvamai/core/client_wrapper.py +20 -17
  9. sarvamai/core/http_client.py +24 -70
  10. sarvamai/core/http_response.py +11 -19
  11. sarvamai/core/pydantic_utilities.py +108 -69
  12. sarvamai/environment.py +3 -10
  13. sarvamai/errors/__init__.py +0 -2
  14. sarvamai/errors/bad_request_error.py +3 -4
  15. sarvamai/errors/forbidden_error.py +3 -4
  16. sarvamai/errors/internal_server_error.py +3 -4
  17. sarvamai/errors/service_unavailable_error.py +2 -4
  18. sarvamai/errors/too_many_requests_error.py +3 -4
  19. sarvamai/errors/unprocessable_entity_error.py +3 -4
  20. sarvamai/requests/__init__.py +0 -18
  21. sarvamai/requests/chat_completion_request_message.py +1 -3
  22. sarvamai/requests/create_chat_completion_response.py +2 -2
  23. sarvamai/requests/diarized_transcript.py +1 -2
  24. sarvamai/requests/error_details.py +1 -0
  25. sarvamai/requests/language_identification_response.py +1 -0
  26. sarvamai/requests/speech_to_text_response.py +2 -1
  27. sarvamai/requests/speech_to_text_translate_response.py +1 -0
  28. sarvamai/requests/text_to_speech_response.py +2 -2
  29. sarvamai/requests/timestamps_model.py +1 -2
  30. sarvamai/requests/translation_response.py +1 -0
  31. sarvamai/requests/transliteration_response.py +1 -0
  32. sarvamai/speech_to_text/__init__.py +0 -2
  33. sarvamai/speech_to_text/client.py +14 -13
  34. sarvamai/speech_to_text/raw_client.py +68 -99
  35. sarvamai/text/__init__.py +0 -2
  36. sarvamai/text/client.py +25 -24
  37. sarvamai/text/raw_client.py +91 -126
  38. sarvamai/text_to_speech/__init__.py +0 -2
  39. sarvamai/text_to_speech/client.py +11 -10
  40. sarvamai/text_to_speech/raw_client.py +38 -49
  41. sarvamai/types/__init__.py +0 -24
  42. sarvamai/types/chat_completion_request_assistant_message.py +3 -3
  43. sarvamai/types/chat_completion_request_message.py +2 -3
  44. sarvamai/types/chat_completion_request_system_message.py +3 -3
  45. sarvamai/types/chat_completion_request_user_message.py +3 -3
  46. sarvamai/types/chat_completion_response_message.py +3 -3
  47. sarvamai/types/choice.py +4 -4
  48. sarvamai/types/completion_usage.py +3 -3
  49. sarvamai/types/create_chat_completion_response.py +3 -3
  50. sarvamai/types/diarized_entry.py +3 -3
  51. sarvamai/types/diarized_transcript.py +3 -3
  52. sarvamai/types/error_details.py +3 -3
  53. sarvamai/types/error_message.py +4 -4
  54. sarvamai/types/language_identification_response.py +2 -2
  55. sarvamai/types/speech_to_text_response.py +3 -3
  56. sarvamai/types/speech_to_text_translate_response.py +3 -3
  57. sarvamai/types/text_to_speech_response.py +2 -2
  58. sarvamai/types/timestamps_model.py +2 -2
  59. sarvamai/types/translation_response.py +2 -2
  60. sarvamai/types/transliteration_response.py +2 -2
  61. sarvamai-0.1.5a6.dist-info/METADATA +174 -0
  62. sarvamai-0.1.5a6.dist-info/RECORD +106 -0
  63. sarvamai/core/events.py +0 -30
  64. sarvamai/core/force_multipart.py +0 -16
  65. sarvamai/requests/audio_data.py +0 -21
  66. sarvamai/requests/audio_message.py +0 -8
  67. sarvamai/requests/error_data.py +0 -15
  68. sarvamai/requests/events_data.py +0 -17
  69. sarvamai/requests/speech_to_text_streaming_response.py +0 -10
  70. sarvamai/requests/speech_to_text_streaming_response_data.py +0 -9
  71. sarvamai/requests/transcription_data.py +0 -35
  72. sarvamai/requests/transcription_metrics.py +0 -15
  73. sarvamai/speech_to_text_streaming/__init__.py +0 -7
  74. sarvamai/speech_to_text_streaming/client.py +0 -189
  75. sarvamai/speech_to_text_streaming/raw_client.py +0 -166
  76. sarvamai/speech_to_text_streaming/socket_client.py +0 -129
  77. sarvamai/speech_to_text_streaming/types/__init__.py +0 -8
  78. sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_language_code.py +0 -8
  79. sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_model.py +0 -5
  80. sarvamai/types/audio_data.py +0 -33
  81. sarvamai/types/audio_data_encoding.py +0 -5
  82. sarvamai/types/audio_message.py +0 -20
  83. sarvamai/types/error_data.py +0 -27
  84. sarvamai/types/events_data.py +0 -28
  85. sarvamai/types/format.py +0 -5
  86. sarvamai/types/speech_to_text_streaming_response.py +0 -22
  87. sarvamai/types/speech_to_text_streaming_response_data.py +0 -9
  88. sarvamai/types/speech_to_text_streaming_response_type.py +0 -5
  89. sarvamai/types/transcription_data.py +0 -45
  90. sarvamai/types/transcription_metrics.py +0 -27
  91. sarvamai-0.1.5a5.dist-info/METADATA +0 -28
  92. sarvamai-0.1.5a5.dist-info/RECORD +0 -134
  93. {sarvamai-0.1.5a5.dist-info → sarvamai-0.1.5a6.dist-info}/WHEEL +0 -0
@@ -1,26 +1,27 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
4
- from json.decoder import JSONDecodeError
5
-
4
+ from ..core.client_wrapper import SyncClientWrapper
6
5
  from .. import core
7
- from ..core.api_error import ApiError
8
- from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
- from ..core.http_response import AsyncHttpResponse, HttpResponse
10
- from ..core.pydantic_utilities import parse_obj_as
6
+ from ..types.speech_to_text_model import SpeechToTextModel
7
+ from ..types.speech_to_text_language import SpeechToTextLanguage
11
8
  from ..core.request_options import RequestOptions
9
+ from ..core.http_response import HttpResponse
10
+ from ..types.speech_to_text_response import SpeechToTextResponse
11
+ from ..core.pydantic_utilities import parse_obj_as
12
12
  from ..errors.bad_request_error import BadRequestError
13
13
  from ..errors.forbidden_error import ForbiddenError
14
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
15
+ from ..errors.too_many_requests_error import TooManyRequestsError
14
16
  from ..errors.internal_server_error import InternalServerError
15
17
  from ..errors.service_unavailable_error import ServiceUnavailableError
16
- from ..errors.too_many_requests_error import TooManyRequestsError
17
- from ..errors.unprocessable_entity_error import UnprocessableEntityError
18
18
  from ..types.error_message import ErrorMessage
19
- from ..types.speech_to_text_language import SpeechToTextLanguage
20
- from ..types.speech_to_text_model import SpeechToTextModel
21
- from ..types.speech_to_text_response import SpeechToTextResponse
19
+ from json.decoder import JSONDecodeError
20
+ from ..core.api_error import ApiError
22
21
  from ..types.speech_to_text_translate_model import SpeechToTextTranslateModel
23
22
  from ..types.speech_to_text_translate_response import SpeechToTextTranslateResponse
23
+ from ..core.client_wrapper import AsyncClientWrapper
24
+ from ..core.http_response import AsyncHttpResponse
24
25
 
25
26
  # this is used as the default value for optional parameters
26
27
  OMIT = typing.cast(typing.Any, ...)
@@ -79,7 +80,6 @@ class RawSpeechToTextClient:
79
80
  """
80
81
  _response = self._client_wrapper.httpx_client.request(
81
82
  "speech-to-text",
82
- base_url=self._client_wrapper.get_environment().base,
83
83
  method="POST",
84
84
  data={
85
85
  "model": model,
@@ -90,7 +90,6 @@ class RawSpeechToTextClient:
90
90
  },
91
91
  request_options=request_options,
92
92
  omit=OMIT,
93
- force_multipart=True,
94
93
  )
95
94
  try:
96
95
  if 200 <= _response.status_code < 300:
@@ -104,74 +103,68 @@ class RawSpeechToTextClient:
104
103
  return HttpResponse(response=_response, data=_data)
105
104
  if _response.status_code == 400:
106
105
  raise BadRequestError(
107
- headers=dict(_response.headers),
108
- body=typing.cast(
106
+ typing.cast(
109
107
  typing.Optional[typing.Any],
110
108
  parse_obj_as(
111
109
  type_=typing.Optional[typing.Any], # type: ignore
112
110
  object_=_response.json(),
113
111
  ),
114
- ),
112
+ )
115
113
  )
116
114
  if _response.status_code == 403:
117
115
  raise ForbiddenError(
118
- headers=dict(_response.headers),
119
- body=typing.cast(
116
+ typing.cast(
120
117
  typing.Optional[typing.Any],
121
118
  parse_obj_as(
122
119
  type_=typing.Optional[typing.Any], # type: ignore
123
120
  object_=_response.json(),
124
121
  ),
125
- ),
122
+ )
126
123
  )
127
124
  if _response.status_code == 422:
128
125
  raise UnprocessableEntityError(
129
- headers=dict(_response.headers),
130
- body=typing.cast(
126
+ typing.cast(
131
127
  typing.Optional[typing.Any],
132
128
  parse_obj_as(
133
129
  type_=typing.Optional[typing.Any], # type: ignore
134
130
  object_=_response.json(),
135
131
  ),
136
- ),
132
+ )
137
133
  )
138
134
  if _response.status_code == 429:
139
135
  raise TooManyRequestsError(
140
- headers=dict(_response.headers),
141
- body=typing.cast(
136
+ typing.cast(
142
137
  typing.Optional[typing.Any],
143
138
  parse_obj_as(
144
139
  type_=typing.Optional[typing.Any], # type: ignore
145
140
  object_=_response.json(),
146
141
  ),
147
- ),
142
+ )
148
143
  )
149
144
  if _response.status_code == 500:
150
145
  raise InternalServerError(
151
- headers=dict(_response.headers),
152
- body=typing.cast(
146
+ typing.cast(
153
147
  typing.Optional[typing.Any],
154
148
  parse_obj_as(
155
149
  type_=typing.Optional[typing.Any], # type: ignore
156
150
  object_=_response.json(),
157
151
  ),
158
- ),
152
+ )
159
153
  )
160
154
  if _response.status_code == 503:
161
155
  raise ServiceUnavailableError(
162
- headers=dict(_response.headers),
163
- body=typing.cast(
156
+ typing.cast(
164
157
  ErrorMessage,
165
158
  parse_obj_as(
166
159
  type_=ErrorMessage, # type: ignore
167
160
  object_=_response.json(),
168
161
  ),
169
- ),
162
+ )
170
163
  )
171
164
  _response_json = _response.json()
172
165
  except JSONDecodeError:
173
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
174
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
166
+ raise ApiError(status_code=_response.status_code, body=_response.text)
167
+ raise ApiError(status_code=_response.status_code, body=_response_json)
175
168
 
176
169
  def translate(
177
170
  self,
@@ -217,7 +210,6 @@ class RawSpeechToTextClient:
217
210
  """
218
211
  _response = self._client_wrapper.httpx_client.request(
219
212
  "speech-to-text-translate",
220
- base_url=self._client_wrapper.get_environment().base,
221
213
  method="POST",
222
214
  data={
223
215
  "prompt": prompt,
@@ -228,7 +220,6 @@ class RawSpeechToTextClient:
228
220
  },
229
221
  request_options=request_options,
230
222
  omit=OMIT,
231
- force_multipart=True,
232
223
  )
233
224
  try:
234
225
  if 200 <= _response.status_code < 300:
@@ -242,74 +233,68 @@ class RawSpeechToTextClient:
242
233
  return HttpResponse(response=_response, data=_data)
243
234
  if _response.status_code == 400:
244
235
  raise BadRequestError(
245
- headers=dict(_response.headers),
246
- body=typing.cast(
236
+ typing.cast(
247
237
  typing.Optional[typing.Any],
248
238
  parse_obj_as(
249
239
  type_=typing.Optional[typing.Any], # type: ignore
250
240
  object_=_response.json(),
251
241
  ),
252
- ),
242
+ )
253
243
  )
254
244
  if _response.status_code == 403:
255
245
  raise ForbiddenError(
256
- headers=dict(_response.headers),
257
- body=typing.cast(
246
+ typing.cast(
258
247
  typing.Optional[typing.Any],
259
248
  parse_obj_as(
260
249
  type_=typing.Optional[typing.Any], # type: ignore
261
250
  object_=_response.json(),
262
251
  ),
263
- ),
252
+ )
264
253
  )
265
254
  if _response.status_code == 422:
266
255
  raise UnprocessableEntityError(
267
- headers=dict(_response.headers),
268
- body=typing.cast(
256
+ typing.cast(
269
257
  typing.Optional[typing.Any],
270
258
  parse_obj_as(
271
259
  type_=typing.Optional[typing.Any], # type: ignore
272
260
  object_=_response.json(),
273
261
  ),
274
- ),
262
+ )
275
263
  )
276
264
  if _response.status_code == 429:
277
265
  raise TooManyRequestsError(
278
- headers=dict(_response.headers),
279
- body=typing.cast(
266
+ typing.cast(
280
267
  typing.Optional[typing.Any],
281
268
  parse_obj_as(
282
269
  type_=typing.Optional[typing.Any], # type: ignore
283
270
  object_=_response.json(),
284
271
  ),
285
- ),
272
+ )
286
273
  )
287
274
  if _response.status_code == 500:
288
275
  raise InternalServerError(
289
- headers=dict(_response.headers),
290
- body=typing.cast(
276
+ typing.cast(
291
277
  typing.Optional[typing.Any],
292
278
  parse_obj_as(
293
279
  type_=typing.Optional[typing.Any], # type: ignore
294
280
  object_=_response.json(),
295
281
  ),
296
- ),
282
+ )
297
283
  )
298
284
  if _response.status_code == 503:
299
285
  raise ServiceUnavailableError(
300
- headers=dict(_response.headers),
301
- body=typing.cast(
286
+ typing.cast(
302
287
  ErrorMessage,
303
288
  parse_obj_as(
304
289
  type_=ErrorMessage, # type: ignore
305
290
  object_=_response.json(),
306
291
  ),
307
- ),
292
+ )
308
293
  )
309
294
  _response_json = _response.json()
310
295
  except JSONDecodeError:
311
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
312
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
296
+ raise ApiError(status_code=_response.status_code, body=_response.text)
297
+ raise ApiError(status_code=_response.status_code, body=_response_json)
313
298
 
314
299
 
315
300
  class AsyncRawSpeechToTextClient:
@@ -365,7 +350,6 @@ class AsyncRawSpeechToTextClient:
365
350
  """
366
351
  _response = await self._client_wrapper.httpx_client.request(
367
352
  "speech-to-text",
368
- base_url=self._client_wrapper.get_environment().base,
369
353
  method="POST",
370
354
  data={
371
355
  "model": model,
@@ -376,7 +360,6 @@ class AsyncRawSpeechToTextClient:
376
360
  },
377
361
  request_options=request_options,
378
362
  omit=OMIT,
379
- force_multipart=True,
380
363
  )
381
364
  try:
382
365
  if 200 <= _response.status_code < 300:
@@ -390,74 +373,68 @@ class AsyncRawSpeechToTextClient:
390
373
  return AsyncHttpResponse(response=_response, data=_data)
391
374
  if _response.status_code == 400:
392
375
  raise BadRequestError(
393
- headers=dict(_response.headers),
394
- body=typing.cast(
376
+ typing.cast(
395
377
  typing.Optional[typing.Any],
396
378
  parse_obj_as(
397
379
  type_=typing.Optional[typing.Any], # type: ignore
398
380
  object_=_response.json(),
399
381
  ),
400
- ),
382
+ )
401
383
  )
402
384
  if _response.status_code == 403:
403
385
  raise ForbiddenError(
404
- headers=dict(_response.headers),
405
- body=typing.cast(
386
+ typing.cast(
406
387
  typing.Optional[typing.Any],
407
388
  parse_obj_as(
408
389
  type_=typing.Optional[typing.Any], # type: ignore
409
390
  object_=_response.json(),
410
391
  ),
411
- ),
392
+ )
412
393
  )
413
394
  if _response.status_code == 422:
414
395
  raise UnprocessableEntityError(
415
- headers=dict(_response.headers),
416
- body=typing.cast(
396
+ typing.cast(
417
397
  typing.Optional[typing.Any],
418
398
  parse_obj_as(
419
399
  type_=typing.Optional[typing.Any], # type: ignore
420
400
  object_=_response.json(),
421
401
  ),
422
- ),
402
+ )
423
403
  )
424
404
  if _response.status_code == 429:
425
405
  raise TooManyRequestsError(
426
- headers=dict(_response.headers),
427
- body=typing.cast(
406
+ typing.cast(
428
407
  typing.Optional[typing.Any],
429
408
  parse_obj_as(
430
409
  type_=typing.Optional[typing.Any], # type: ignore
431
410
  object_=_response.json(),
432
411
  ),
433
- ),
412
+ )
434
413
  )
435
414
  if _response.status_code == 500:
436
415
  raise InternalServerError(
437
- headers=dict(_response.headers),
438
- body=typing.cast(
416
+ typing.cast(
439
417
  typing.Optional[typing.Any],
440
418
  parse_obj_as(
441
419
  type_=typing.Optional[typing.Any], # type: ignore
442
420
  object_=_response.json(),
443
421
  ),
444
- ),
422
+ )
445
423
  )
446
424
  if _response.status_code == 503:
447
425
  raise ServiceUnavailableError(
448
- headers=dict(_response.headers),
449
- body=typing.cast(
426
+ typing.cast(
450
427
  ErrorMessage,
451
428
  parse_obj_as(
452
429
  type_=ErrorMessage, # type: ignore
453
430
  object_=_response.json(),
454
431
  ),
455
- ),
432
+ )
456
433
  )
457
434
  _response_json = _response.json()
458
435
  except JSONDecodeError:
459
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
460
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
436
+ raise ApiError(status_code=_response.status_code, body=_response.text)
437
+ raise ApiError(status_code=_response.status_code, body=_response_json)
461
438
 
462
439
  async def translate(
463
440
  self,
@@ -503,7 +480,6 @@ class AsyncRawSpeechToTextClient:
503
480
  """
504
481
  _response = await self._client_wrapper.httpx_client.request(
505
482
  "speech-to-text-translate",
506
- base_url=self._client_wrapper.get_environment().base,
507
483
  method="POST",
508
484
  data={
509
485
  "prompt": prompt,
@@ -514,7 +490,6 @@ class AsyncRawSpeechToTextClient:
514
490
  },
515
491
  request_options=request_options,
516
492
  omit=OMIT,
517
- force_multipart=True,
518
493
  )
519
494
  try:
520
495
  if 200 <= _response.status_code < 300:
@@ -528,71 +503,65 @@ class AsyncRawSpeechToTextClient:
528
503
  return AsyncHttpResponse(response=_response, data=_data)
529
504
  if _response.status_code == 400:
530
505
  raise BadRequestError(
531
- headers=dict(_response.headers),
532
- body=typing.cast(
506
+ typing.cast(
533
507
  typing.Optional[typing.Any],
534
508
  parse_obj_as(
535
509
  type_=typing.Optional[typing.Any], # type: ignore
536
510
  object_=_response.json(),
537
511
  ),
538
- ),
512
+ )
539
513
  )
540
514
  if _response.status_code == 403:
541
515
  raise ForbiddenError(
542
- headers=dict(_response.headers),
543
- body=typing.cast(
516
+ typing.cast(
544
517
  typing.Optional[typing.Any],
545
518
  parse_obj_as(
546
519
  type_=typing.Optional[typing.Any], # type: ignore
547
520
  object_=_response.json(),
548
521
  ),
549
- ),
522
+ )
550
523
  )
551
524
  if _response.status_code == 422:
552
525
  raise UnprocessableEntityError(
553
- headers=dict(_response.headers),
554
- body=typing.cast(
526
+ typing.cast(
555
527
  typing.Optional[typing.Any],
556
528
  parse_obj_as(
557
529
  type_=typing.Optional[typing.Any], # type: ignore
558
530
  object_=_response.json(),
559
531
  ),
560
- ),
532
+ )
561
533
  )
562
534
  if _response.status_code == 429:
563
535
  raise TooManyRequestsError(
564
- headers=dict(_response.headers),
565
- body=typing.cast(
536
+ typing.cast(
566
537
  typing.Optional[typing.Any],
567
538
  parse_obj_as(
568
539
  type_=typing.Optional[typing.Any], # type: ignore
569
540
  object_=_response.json(),
570
541
  ),
571
- ),
542
+ )
572
543
  )
573
544
  if _response.status_code == 500:
574
545
  raise InternalServerError(
575
- headers=dict(_response.headers),
576
- body=typing.cast(
546
+ typing.cast(
577
547
  typing.Optional[typing.Any],
578
548
  parse_obj_as(
579
549
  type_=typing.Optional[typing.Any], # type: ignore
580
550
  object_=_response.json(),
581
551
  ),
582
- ),
552
+ )
583
553
  )
584
554
  if _response.status_code == 503:
585
555
  raise ServiceUnavailableError(
586
- headers=dict(_response.headers),
587
- body=typing.cast(
556
+ typing.cast(
588
557
  ErrorMessage,
589
558
  parse_obj_as(
590
559
  type_=ErrorMessage, # type: ignore
591
560
  object_=_response.json(),
592
561
  ),
593
- ),
562
+ )
594
563
  )
595
564
  _response_json = _response.json()
596
565
  except JSONDecodeError:
597
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
598
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
566
+ raise ApiError(status_code=_response.status_code, body=_response.text)
567
+ raise ApiError(status_code=_response.status_code, body=_response_json)
sarvamai/text/__init__.py CHANGED
@@ -1,4 +1,2 @@
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,23 +1,24 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
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
10
- from ..types.translate_mode import TranslateMode
11
- from ..types.translate_model import TranslateModel
4
+ from ..core.client_wrapper import SyncClientWrapper
5
+ from .raw_client import RawTextClient
12
6
  from ..types.translate_source_language import TranslateSourceLanguage
13
- from ..types.translate_speaker_gender import TranslateSpeakerGender
14
7
  from ..types.translate_target_language import TranslateTargetLanguage
15
- from ..types.translation_response import TranslationResponse
16
- from ..types.translatiterate_target_language import TranslatiterateTargetLanguage
8
+ from ..types.translate_speaker_gender import TranslateSpeakerGender
9
+ from ..types.translate_mode import TranslateMode
10
+ from ..types.translate_model import TranslateModel
17
11
  from ..types.transliterate_mode import TransliterateMode
12
+ from ..types.numerals_format import NumeralsFormat
13
+ from ..core.request_options import RequestOptions
14
+ from ..types.translation_response import TranslationResponse
15
+ from ..types.language_identification_response import LanguageIdentificationResponse
18
16
  from ..types.transliterate_source_language import TransliterateSourceLanguage
17
+ from ..types.translatiterate_target_language import TranslatiterateTargetLanguage
18
+ from ..types.spoken_form_numerals_format import SpokenFormNumeralsFormat
19
19
  from ..types.transliteration_response import TransliterationResponse
20
- from .raw_client import AsyncRawTextClient, RawTextClient
20
+ from ..core.client_wrapper import AsyncClientWrapper
21
+ from .raw_client import AsyncRawTextClient
21
22
 
22
23
  # this is used as the default value for optional parameters
23
24
  OMIT = typing.cast(typing.Any, ...)
@@ -179,7 +180,7 @@ class TextClient:
179
180
  target_language_code="bn-IN",
180
181
  )
181
182
  """
182
- _response = self._raw_client.translate(
183
+ response = self._raw_client.translate(
183
184
  input=input,
184
185
  source_language_code=source_language_code,
185
186
  target_language_code=target_language_code,
@@ -191,7 +192,7 @@ class TextClient:
191
192
  numerals_format=numerals_format,
192
193
  request_options=request_options,
193
194
  )
194
- return _response.data
195
+ return response.data
195
196
 
196
197
  def identify_language(
197
198
  self, *, input: str, request_options: typing.Optional[RequestOptions] = None
@@ -223,8 +224,8 @@ class TextClient:
223
224
  input="input",
224
225
  )
225
226
  """
226
- _response = self._raw_client.identify_language(input=input, request_options=request_options)
227
- return _response.data
227
+ response = self._raw_client.identify_language(input=input, request_options=request_options)
228
+ return response.data
228
229
 
229
230
  def transliterate(
230
231
  self,
@@ -335,7 +336,7 @@ class TextClient:
335
336
  target_language_code="bn-IN",
336
337
  )
337
338
  """
338
- _response = self._raw_client.transliterate(
339
+ response = self._raw_client.transliterate(
339
340
  input=input,
340
341
  source_language_code=source_language_code,
341
342
  target_language_code=target_language_code,
@@ -344,7 +345,7 @@ class TextClient:
344
345
  spoken_form=spoken_form,
345
346
  request_options=request_options,
346
347
  )
347
- return _response.data
348
+ return response.data
348
349
 
349
350
 
350
351
  class AsyncTextClient:
@@ -511,7 +512,7 @@ class AsyncTextClient:
511
512
 
512
513
  asyncio.run(main())
513
514
  """
514
- _response = await self._raw_client.translate(
515
+ response = await self._raw_client.translate(
515
516
  input=input,
516
517
  source_language_code=source_language_code,
517
518
  target_language_code=target_language_code,
@@ -523,7 +524,7 @@ class AsyncTextClient:
523
524
  numerals_format=numerals_format,
524
525
  request_options=request_options,
525
526
  )
526
- return _response.data
527
+ return response.data
527
528
 
528
529
  async def identify_language(
529
530
  self, *, input: str, request_options: typing.Optional[RequestOptions] = None
@@ -563,8 +564,8 @@ class AsyncTextClient:
563
564
 
564
565
  asyncio.run(main())
565
566
  """
566
- _response = await self._raw_client.identify_language(input=input, request_options=request_options)
567
- return _response.data
567
+ response = await self._raw_client.identify_language(input=input, request_options=request_options)
568
+ return response.data
568
569
 
569
570
  async def transliterate(
570
571
  self,
@@ -683,7 +684,7 @@ class AsyncTextClient:
683
684
 
684
685
  asyncio.run(main())
685
686
  """
686
- _response = await self._raw_client.transliterate(
687
+ response = await self._raw_client.transliterate(
687
688
  input=input,
688
689
  source_language_code=source_language_code,
689
690
  target_language_code=target_language_code,
@@ -692,4 +693,4 @@ class AsyncTextClient:
692
693
  spoken_form=spoken_form,
693
694
  request_options=request_options,
694
695
  )
695
- return _response.data
696
+ return response.data