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,10 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import typing
4
-
5
3
  from ..core.api_error import ApiError
4
+ import typing
6
5
 
7
6
 
8
7
  class TooManyRequestsError(ApiError):
9
- def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
10
- super().__init__(status_code=429, headers=headers, body=body)
8
+ def __init__(self, body: typing.Optional[typing.Any]):
9
+ super().__init__(status_code=429, body=body)
@@ -1,10 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import typing
4
-
5
3
  from ..core.api_error import ApiError
4
+ import typing
6
5
 
7
6
 
8
7
  class UnprocessableEntityError(ApiError):
9
- def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
10
- super().__init__(status_code=422, headers=headers, body=body)
8
+ def __init__(self, body: typing.Optional[typing.Any]):
9
+ super().__init__(status_code=422, body=body)
@@ -1,9 +1,5 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- # isort: skip_file
4
-
5
- from .audio_data import AudioDataParams
6
- from .audio_message import AudioMessageParams
7
3
  from .chat_completion_request_assistant_message import ChatCompletionRequestAssistantMessageParams
8
4
  from .chat_completion_request_message import (
9
5
  ChatCompletionRequestMessageParams,
@@ -19,26 +15,18 @@ from .completion_usage import CompletionUsageParams
19
15
  from .create_chat_completion_response import CreateChatCompletionResponseParams
20
16
  from .diarized_entry import DiarizedEntryParams
21
17
  from .diarized_transcript import DiarizedTranscriptParams
22
- from .error_data import ErrorDataParams
23
18
  from .error_details import ErrorDetailsParams
24
19
  from .error_message import ErrorMessageParams
25
- from .events_data import EventsDataParams
26
20
  from .language_identification_response import LanguageIdentificationResponseParams
27
21
  from .speech_to_text_response import SpeechToTextResponseParams
28
- from .speech_to_text_streaming_response import SpeechToTextStreamingResponseParams
29
- from .speech_to_text_streaming_response_data import SpeechToTextStreamingResponseDataParams
30
22
  from .speech_to_text_translate_response import SpeechToTextTranslateResponseParams
31
23
  from .stop_configuration import StopConfigurationParams
32
24
  from .text_to_speech_response import TextToSpeechResponseParams
33
25
  from .timestamps_model import TimestampsModelParams
34
- from .transcription_data import TranscriptionDataParams
35
- from .transcription_metrics import TranscriptionMetricsParams
36
26
  from .translation_response import TranslationResponseParams
37
27
  from .transliteration_response import TransliterationResponseParams
38
28
 
39
29
  __all__ = [
40
- "AudioDataParams",
41
- "AudioMessageParams",
42
30
  "ChatCompletionRequestAssistantMessageParams",
43
31
  "ChatCompletionRequestMessageParams",
44
32
  "ChatCompletionRequestMessage_AssistantParams",
@@ -52,20 +40,14 @@ __all__ = [
52
40
  "CreateChatCompletionResponseParams",
53
41
  "DiarizedEntryParams",
54
42
  "DiarizedTranscriptParams",
55
- "ErrorDataParams",
56
43
  "ErrorDetailsParams",
57
44
  "ErrorMessageParams",
58
- "EventsDataParams",
59
45
  "LanguageIdentificationResponseParams",
60
46
  "SpeechToTextResponseParams",
61
- "SpeechToTextStreamingResponseDataParams",
62
- "SpeechToTextStreamingResponseParams",
63
47
  "SpeechToTextTranslateResponseParams",
64
48
  "StopConfigurationParams",
65
49
  "TextToSpeechResponseParams",
66
50
  "TimestampsModelParams",
67
- "TranscriptionDataParams",
68
- "TranscriptionMetricsParams",
69
51
  "TranslationResponseParams",
70
52
  "TransliterationResponseParams",
71
53
  ]
@@ -1,10 +1,8 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  from __future__ import annotations
4
-
5
- import typing
6
-
7
4
  import typing_extensions
5
+ import typing
8
6
 
9
7
 
10
8
  class ChatCompletionRequestMessage_AssistantParams(typing_extensions.TypedDict):
@@ -1,9 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import typing
4
-
5
3
  import typing_extensions
4
+ import typing
6
5
  from .choice import ChoiceParams
6
+ import typing_extensions
7
7
  from .completion_usage import CompletionUsageParams
8
8
 
9
9
 
@@ -1,8 +1,7 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import typing
4
-
5
3
  import typing_extensions
4
+ import typing
6
5
  from .diarized_entry import DiarizedEntryParams
7
6
 
8
7
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  import typing_extensions
4
4
  from ..types.error_code import ErrorCode
5
+ import typing_extensions
5
6
 
6
7
 
7
8
  class ErrorDetailsParams(typing_extensions.TypedDict):
@@ -1,6 +1,7 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing_extensions
4
+ import typing_extensions
4
5
 
5
6
 
6
7
  class LanguageIdentificationResponseParams(typing_extensions.TypedDict):
@@ -1,8 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing_extensions
4
- from .diarized_transcript import DiarizedTranscriptParams
4
+ import typing_extensions
5
5
  from .timestamps_model import TimestampsModelParams
6
+ from .diarized_transcript import DiarizedTranscriptParams
6
7
 
7
8
 
8
9
  class SpeechToTextResponseParams(typing_extensions.TypedDict):
@@ -1,5 +1,6 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ import typing_extensions
3
4
  import typing_extensions
4
5
  from ..types.speech_to_text_translate_language import SpeechToTextTranslateLanguage
5
6
  from .diarized_transcript import DiarizedTranscriptParams
@@ -1,8 +1,8 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import typing
4
-
5
3
  import typing_extensions
4
+ import typing_extensions
5
+ import typing
6
6
 
7
7
 
8
8
  class TextToSpeechResponseParams(typing_extensions.TypedDict):
@@ -1,8 +1,7 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import typing
4
-
5
3
  import typing_extensions
4
+ import typing
6
5
 
7
6
 
8
7
  class TimestampsModelParams(typing_extensions.TypedDict):
@@ -1,6 +1,7 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing_extensions
4
+ import typing_extensions
4
5
 
5
6
 
6
7
  class TranslationResponseParams(typing_extensions.TypedDict):
@@ -1,6 +1,7 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing_extensions
4
+ import typing_extensions
4
5
 
5
6
 
6
7
  class TransliterationResponseParams(typing_extensions.TypedDict):
@@ -1,4 +1,2 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- # isort: skip_file
4
-
@@ -1,16 +1,17 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
4
-
4
+ from ..core.client_wrapper import SyncClientWrapper
5
+ from .raw_client import RawSpeechToTextClient
5
6
  from .. import core
6
- from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
- from ..core.request_options import RequestOptions
8
- from ..types.speech_to_text_language import SpeechToTextLanguage
9
7
  from ..types.speech_to_text_model import SpeechToTextModel
8
+ from ..types.speech_to_text_language import SpeechToTextLanguage
9
+ from ..core.request_options import RequestOptions
10
10
  from ..types.speech_to_text_response import SpeechToTextResponse
11
11
  from ..types.speech_to_text_translate_model import SpeechToTextTranslateModel
12
12
  from ..types.speech_to_text_translate_response import SpeechToTextTranslateResponse
13
- from .raw_client import AsyncRawSpeechToTextClient, RawSpeechToTextClient
13
+ from ..core.client_wrapper import AsyncClientWrapper
14
+ from .raw_client import AsyncRawSpeechToTextClient
14
15
 
15
16
  # this is used as the default value for optional parameters
16
17
  OMIT = typing.cast(typing.Any, ...)
@@ -87,10 +88,10 @@ class SpeechToTextClient:
87
88
  )
88
89
  client.speech_to_text.transcribe()
89
90
  """
90
- _response = self._raw_client.transcribe(
91
+ response = self._raw_client.transcribe(
91
92
  file=file, model=model, language_code=language_code, request_options=request_options
92
93
  )
93
- return _response.data
94
+ return response.data
94
95
 
95
96
  def translate(
96
97
  self,
@@ -143,8 +144,8 @@ class SpeechToTextClient:
143
144
  )
144
145
  client.speech_to_text.translate()
145
146
  """
146
- _response = self._raw_client.translate(file=file, prompt=prompt, model=model, request_options=request_options)
147
- return _response.data
147
+ response = self._raw_client.translate(file=file, prompt=prompt, model=model, request_options=request_options)
148
+ return response.data
148
149
 
149
150
 
150
151
  class AsyncSpeechToTextClient:
@@ -226,10 +227,10 @@ class AsyncSpeechToTextClient:
226
227
 
227
228
  asyncio.run(main())
228
229
  """
229
- _response = await self._raw_client.transcribe(
230
+ response = await self._raw_client.transcribe(
230
231
  file=file, model=model, language_code=language_code, request_options=request_options
231
232
  )
232
- return _response.data
233
+ return response.data
233
234
 
234
235
  async def translate(
235
236
  self,
@@ -290,7 +291,7 @@ class AsyncSpeechToTextClient:
290
291
 
291
292
  asyncio.run(main())
292
293
  """
293
- _response = await self._raw_client.translate(
294
+ response = await self._raw_client.translate(
294
295
  file=file, prompt=prompt, model=model, request_options=request_options
295
296
  )
296
- return _response.data
297
+ return response.data