murf 1.2.2__tar.gz → 2.0.0__tar.gz
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.
Potentially problematic release.
This version of murf might be problematic. Click here for more details.
- {murf-1.2.2 → murf-2.0.0}/PKG-INFO +1 -1
- {murf-1.2.2 → murf-2.0.0}/pyproject.toml +1 -1
- {murf-1.2.2 → murf-2.0.0}/src/murf/__init__.py +31 -1
- {murf-1.2.2 → murf-2.0.0}/src/murf/auth/client.py +11 -9
- {murf-1.2.2 → murf-2.0.0}/src/murf/base_client.py +3 -20
- {murf-1.2.2 → murf-2.0.0}/src/murf/client.py +9 -8
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/__init__.py +4 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/client_wrapper.py +18 -17
- murf-2.0.0/src/murf/core/unchecked_base_model.py +305 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/jobs/client.py +37 -31
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/languages/client.py +25 -21
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/projects/client.py +37 -31
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing_client.py +9 -8
- murf-2.0.0/src/murf/environment.py +14 -0
- murf-2.0.0/src/murf/stream_input/__init__.py +5 -0
- murf-2.0.0/src/murf/stream_input/types/__init__.py +6 -0
- murf-2.0.0/src/murf/stream_input/types/receive_message.py +7 -0
- murf-2.0.0/src/murf/stream_input/types/send_message.py +9 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/text/client.py +15 -13
- {murf-1.2.2 → murf-2.0.0}/src/murf/text_to_speech/client.py +43 -37
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/__init__.py +34 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/api_job_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/api_project_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/api_voice.py +2 -2
- murf-2.0.0/src/murf/types/audio_output.py +27 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/auth_token_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/character_count.py +2 -2
- murf-2.0.0/src/murf/types/clear_context.py +20 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/dub_api_detail_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/dub_job_status_response.py +2 -2
- murf-2.0.0/src/murf/types/final_output.py +27 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/form_data_content_disposition.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/generate_speech_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/group_api_project_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/locale_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/metadata.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/murf_api_translation_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/pronunciation_detail.py +2 -2
- murf-2.0.0/src/murf/types/send_text.py +32 -0
- murf-2.0.0/src/murf/types/set_advanced_settings.py +20 -0
- murf-2.0.0/src/murf/types/set_voice_configuration.py +20 -0
- murf-2.0.0/src/murf/types/set_voice_configuration_voice_config.py +57 -0
- murf-2.0.0/src/murf/types/set_voice_configuration_voice_config_pronunciation_dictionary_value.py +30 -0
- murf-2.0.0/src/murf/types/set_voice_configuration_voice_config_pronunciation_dictionary_value_type.py +7 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/source_locale_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/speech_to_speech_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/style_details.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/translation.py +2 -2
- murf-2.0.0/src/murf/types/tts_request_both_payload.py +29 -0
- murf-2.0.0/src/murf/types/tts_request_both_payload_voice_config.py +44 -0
- murf-2.0.0/src/murf/types/tts_request_both_payload_voice_config_pronunciation_dictionary.py +22 -0
- murf-2.0.0/src/murf/types/tts_request_both_payload_voice_config_pronunciation_dictionary_guess.py +20 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/word_duration_response.py +2 -2
- {murf-1.2.2 → murf-2.0.0}/src/murf/voice_changer/client.py +17 -15
- murf-1.2.2/src/murf/environment.py +0 -7
- {murf-1.2.2 → murf-2.0.0}/LICENSE +0 -0
- {murf-1.2.2 → murf-2.0.0}/README.md +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/auth/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/api_error.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/datetime_utils.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/file.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/http_client.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/jsonable_encoder.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/pydantic_utilities.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/query_encoder.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/remove_none_from_dict.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/request_options.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/core/serialization.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/client.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/jobs/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/jobs/types/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/jobs/types/jobs_create_request_priority.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/jobs/types/jobs_create_with_project_id_request_priority.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/languages/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/projects/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/projects/types/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/dubbing/projects/types/api_create_project_request_dubbing_type.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/errors/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/errors/bad_request_error.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/errors/forbidden_error.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/errors/internal_server_error.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/errors/payment_required_error.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/errors/service_unavailable_error.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/errors/unauthorized_error.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/py.typed +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/text/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/text_to_speech/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/text_to_speech/types/__init__.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/text_to_speech/types/generate_speech_request_model_version.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/api_job_response_dubbing_type.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/api_job_response_priority.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/api_project_response_dubbing_type.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/api_voice_gender.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/locale_response_supports_item.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/types/pronunciation_detail_type.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/utils.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/version.py +0 -0
- {murf-1.2.2 → murf-2.0.0}/src/murf/voice_changer/__init__.py +0 -0
|
@@ -8,10 +8,13 @@ from .types import (
|
|
|
8
8
|
ApiProjectResponseDubbingType,
|
|
9
9
|
ApiVoice,
|
|
10
10
|
ApiVoiceGender,
|
|
11
|
+
AudioOutput,
|
|
11
12
|
AuthTokenResponse,
|
|
12
13
|
CharacterCount,
|
|
14
|
+
ClearContext,
|
|
13
15
|
DubApiDetailResponse,
|
|
14
16
|
DubJobStatusResponse,
|
|
17
|
+
FinalOutput,
|
|
15
18
|
FormDataContentDisposition,
|
|
16
19
|
GenerateSpeechResponse,
|
|
17
20
|
GroupApiProjectResponse,
|
|
@@ -21,10 +24,20 @@ from .types import (
|
|
|
21
24
|
MurfApiTranslationResponse,
|
|
22
25
|
PronunciationDetail,
|
|
23
26
|
PronunciationDetailType,
|
|
27
|
+
SendText,
|
|
28
|
+
SetAdvancedSettings,
|
|
29
|
+
SetVoiceConfiguration,
|
|
30
|
+
SetVoiceConfigurationVoiceConfig,
|
|
31
|
+
SetVoiceConfigurationVoiceConfigPronunciationDictionaryValue,
|
|
32
|
+
SetVoiceConfigurationVoiceConfigPronunciationDictionaryValueType,
|
|
24
33
|
SourceLocaleResponse,
|
|
25
34
|
SpeechToSpeechResponse,
|
|
26
35
|
StyleDetails,
|
|
27
36
|
Translation,
|
|
37
|
+
TtsRequestBothPayload,
|
|
38
|
+
TtsRequestBothPayloadVoiceConfig,
|
|
39
|
+
TtsRequestBothPayloadVoiceConfigPronunciationDictionary,
|
|
40
|
+
TtsRequestBothPayloadVoiceConfigPronunciationDictionaryGuess,
|
|
28
41
|
WordDurationResponse,
|
|
29
42
|
)
|
|
30
43
|
from .errors import (
|
|
@@ -35,10 +48,11 @@ from .errors import (
|
|
|
35
48
|
ServiceUnavailableError,
|
|
36
49
|
UnauthorizedError,
|
|
37
50
|
)
|
|
38
|
-
from . import auth, dubbing, text, text_to_speech, voice_changer
|
|
51
|
+
from . import auth, dubbing, stream_input, text, text_to_speech, voice_changer
|
|
39
52
|
from .client import AsyncMurf, Murf
|
|
40
53
|
from .dubbing_client import MurfDub
|
|
41
54
|
from .environment import MurfEnvironment
|
|
55
|
+
from .stream_input import ReceiveMessage, SendMessage
|
|
42
56
|
from .text_to_speech import GenerateSpeechRequestModelVersion
|
|
43
57
|
from .version import __version__
|
|
44
58
|
|
|
@@ -51,11 +65,14 @@ __all__ = [
|
|
|
51
65
|
"ApiVoice",
|
|
52
66
|
"ApiVoiceGender",
|
|
53
67
|
"AsyncMurf",
|
|
68
|
+
"AudioOutput",
|
|
54
69
|
"AuthTokenResponse",
|
|
55
70
|
"BadRequestError",
|
|
56
71
|
"CharacterCount",
|
|
72
|
+
"ClearContext",
|
|
57
73
|
"DubApiDetailResponse",
|
|
58
74
|
"DubJobStatusResponse",
|
|
75
|
+
"FinalOutput",
|
|
59
76
|
"ForbiddenError",
|
|
60
77
|
"FormDataContentDisposition",
|
|
61
78
|
"GenerateSpeechRequestModelVersion",
|
|
@@ -72,16 +89,29 @@ __all__ = [
|
|
|
72
89
|
"PaymentRequiredError",
|
|
73
90
|
"PronunciationDetail",
|
|
74
91
|
"PronunciationDetailType",
|
|
92
|
+
"ReceiveMessage",
|
|
93
|
+
"SendMessage",
|
|
94
|
+
"SendText",
|
|
75
95
|
"ServiceUnavailableError",
|
|
96
|
+
"SetAdvancedSettings",
|
|
97
|
+
"SetVoiceConfiguration",
|
|
98
|
+
"SetVoiceConfigurationVoiceConfig",
|
|
99
|
+
"SetVoiceConfigurationVoiceConfigPronunciationDictionaryValue",
|
|
100
|
+
"SetVoiceConfigurationVoiceConfigPronunciationDictionaryValueType",
|
|
76
101
|
"SourceLocaleResponse",
|
|
77
102
|
"SpeechToSpeechResponse",
|
|
78
103
|
"StyleDetails",
|
|
79
104
|
"Translation",
|
|
105
|
+
"TtsRequestBothPayload",
|
|
106
|
+
"TtsRequestBothPayloadVoiceConfig",
|
|
107
|
+
"TtsRequestBothPayloadVoiceConfigPronunciationDictionary",
|
|
108
|
+
"TtsRequestBothPayloadVoiceConfigPronunciationDictionaryGuess",
|
|
80
109
|
"UnauthorizedError",
|
|
81
110
|
"WordDurationResponse",
|
|
82
111
|
"__version__",
|
|
83
112
|
"auth",
|
|
84
113
|
"dubbing",
|
|
114
|
+
"stream_input",
|
|
85
115
|
"text",
|
|
86
116
|
"text_to_speech",
|
|
87
117
|
"voice_changer",
|
|
@@ -4,7 +4,7 @@ from ..core.client_wrapper import SyncClientWrapper
|
|
|
4
4
|
import typing
|
|
5
5
|
from ..core.request_options import RequestOptions
|
|
6
6
|
from ..types.auth_token_response import AuthTokenResponse
|
|
7
|
-
from ..core.
|
|
7
|
+
from ..core.unchecked_base_model import construct_type
|
|
8
8
|
from ..errors.bad_request_error import BadRequestError
|
|
9
9
|
from ..errors.unauthorized_error import UnauthorizedError
|
|
10
10
|
from ..errors.service_unavailable_error import ServiceUnavailableError
|
|
@@ -42,6 +42,7 @@ class AuthClient:
|
|
|
42
42
|
"""
|
|
43
43
|
_response = self._client_wrapper.httpx_client.request(
|
|
44
44
|
"v1/auth/token",
|
|
45
|
+
base_url=self._client_wrapper.get_environment().base,
|
|
45
46
|
method="GET",
|
|
46
47
|
request_options=request_options,
|
|
47
48
|
)
|
|
@@ -49,7 +50,7 @@ class AuthClient:
|
|
|
49
50
|
if 200 <= _response.status_code < 300:
|
|
50
51
|
return typing.cast(
|
|
51
52
|
AuthTokenResponse,
|
|
52
|
-
|
|
53
|
+
construct_type(
|
|
53
54
|
type_=AuthTokenResponse, # type: ignore
|
|
54
55
|
object_=_response.json(),
|
|
55
56
|
),
|
|
@@ -58,7 +59,7 @@ class AuthClient:
|
|
|
58
59
|
raise BadRequestError(
|
|
59
60
|
typing.cast(
|
|
60
61
|
typing.Optional[typing.Any],
|
|
61
|
-
|
|
62
|
+
construct_type(
|
|
62
63
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
63
64
|
object_=_response.json(),
|
|
64
65
|
),
|
|
@@ -68,7 +69,7 @@ class AuthClient:
|
|
|
68
69
|
raise UnauthorizedError(
|
|
69
70
|
typing.cast(
|
|
70
71
|
typing.Optional[typing.Any],
|
|
71
|
-
|
|
72
|
+
construct_type(
|
|
72
73
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
73
74
|
object_=_response.json(),
|
|
74
75
|
),
|
|
@@ -78,7 +79,7 @@ class AuthClient:
|
|
|
78
79
|
raise ServiceUnavailableError(
|
|
79
80
|
typing.cast(
|
|
80
81
|
typing.Optional[typing.Any],
|
|
81
|
-
|
|
82
|
+
construct_type(
|
|
82
83
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
83
84
|
object_=_response.json(),
|
|
84
85
|
),
|
|
@@ -127,6 +128,7 @@ class AsyncAuthClient:
|
|
|
127
128
|
"""
|
|
128
129
|
_response = await self._client_wrapper.httpx_client.request(
|
|
129
130
|
"v1/auth/token",
|
|
131
|
+
base_url=self._client_wrapper.get_environment().base,
|
|
130
132
|
method="GET",
|
|
131
133
|
request_options=request_options,
|
|
132
134
|
)
|
|
@@ -134,7 +136,7 @@ class AsyncAuthClient:
|
|
|
134
136
|
if 200 <= _response.status_code < 300:
|
|
135
137
|
return typing.cast(
|
|
136
138
|
AuthTokenResponse,
|
|
137
|
-
|
|
139
|
+
construct_type(
|
|
138
140
|
type_=AuthTokenResponse, # type: ignore
|
|
139
141
|
object_=_response.json(),
|
|
140
142
|
),
|
|
@@ -143,7 +145,7 @@ class AsyncAuthClient:
|
|
|
143
145
|
raise BadRequestError(
|
|
144
146
|
typing.cast(
|
|
145
147
|
typing.Optional[typing.Any],
|
|
146
|
-
|
|
148
|
+
construct_type(
|
|
147
149
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
148
150
|
object_=_response.json(),
|
|
149
151
|
),
|
|
@@ -153,7 +155,7 @@ class AsyncAuthClient:
|
|
|
153
155
|
raise UnauthorizedError(
|
|
154
156
|
typing.cast(
|
|
155
157
|
typing.Optional[typing.Any],
|
|
156
|
-
|
|
158
|
+
construct_type(
|
|
157
159
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
158
160
|
object_=_response.json(),
|
|
159
161
|
),
|
|
@@ -163,7 +165,7 @@ class AsyncAuthClient:
|
|
|
163
165
|
raise ServiceUnavailableError(
|
|
164
166
|
typing.cast(
|
|
165
167
|
typing.Optional[typing.Any],
|
|
166
|
-
|
|
168
|
+
construct_type(
|
|
167
169
|
type_=typing.Optional[typing.Any], # type: ignore
|
|
168
170
|
object_=_response.json(),
|
|
169
171
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
import typing
|
|
4
3
|
from .environment import MurfEnvironment
|
|
4
|
+
import typing
|
|
5
5
|
import httpx
|
|
6
6
|
from .core.client_wrapper import SyncClientWrapper
|
|
7
7
|
from .auth.client import AuthClient
|
|
@@ -23,9 +23,6 @@ class BaseClient:
|
|
|
23
23
|
|
|
24
24
|
Parameters
|
|
25
25
|
----------
|
|
26
|
-
base_url : typing.Optional[str]
|
|
27
|
-
The base url to use for requests from the client.
|
|
28
|
-
|
|
29
26
|
environment : MurfEnvironment
|
|
30
27
|
The environment to use for requests from the client. from .environment import MurfEnvironment
|
|
31
28
|
|
|
@@ -57,7 +54,6 @@ class BaseClient:
|
|
|
57
54
|
def __init__(
|
|
58
55
|
self,
|
|
59
56
|
*,
|
|
60
|
-
base_url: typing.Optional[str] = None,
|
|
61
57
|
environment: MurfEnvironment = MurfEnvironment.DEFAULT,
|
|
62
58
|
api_key: typing.Optional[str] = None,
|
|
63
59
|
timeout: typing.Optional[float] = None,
|
|
@@ -66,7 +62,7 @@ class BaseClient:
|
|
|
66
62
|
):
|
|
67
63
|
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
|
|
68
64
|
self._client_wrapper = SyncClientWrapper(
|
|
69
|
-
|
|
65
|
+
environment=environment,
|
|
70
66
|
api_key=api_key,
|
|
71
67
|
httpx_client=httpx_client
|
|
72
68
|
if httpx_client is not None
|
|
@@ -88,9 +84,6 @@ class AsyncBaseClient:
|
|
|
88
84
|
|
|
89
85
|
Parameters
|
|
90
86
|
----------
|
|
91
|
-
base_url : typing.Optional[str]
|
|
92
|
-
The base url to use for requests from the client.
|
|
93
|
-
|
|
94
87
|
environment : MurfEnvironment
|
|
95
88
|
The environment to use for requests from the client. from .environment import MurfEnvironment
|
|
96
89
|
|
|
@@ -122,7 +115,6 @@ class AsyncBaseClient:
|
|
|
122
115
|
def __init__(
|
|
123
116
|
self,
|
|
124
117
|
*,
|
|
125
|
-
base_url: typing.Optional[str] = None,
|
|
126
118
|
environment: MurfEnvironment = MurfEnvironment.DEFAULT,
|
|
127
119
|
api_key: typing.Optional[str] = None,
|
|
128
120
|
timeout: typing.Optional[float] = None,
|
|
@@ -131,7 +123,7 @@ class AsyncBaseClient:
|
|
|
131
123
|
):
|
|
132
124
|
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
|
|
133
125
|
self._client_wrapper = AsyncClientWrapper(
|
|
134
|
-
|
|
126
|
+
environment=environment,
|
|
135
127
|
api_key=api_key,
|
|
136
128
|
httpx_client=httpx_client
|
|
137
129
|
if httpx_client is not None
|
|
@@ -145,12 +137,3 @@ class AsyncBaseClient:
|
|
|
145
137
|
self.text = AsyncTextClient(client_wrapper=self._client_wrapper)
|
|
146
138
|
self.voice_changer = AsyncVoiceChangerClient(client_wrapper=self._client_wrapper)
|
|
147
139
|
self.dubbing = AsyncDubbingClient(client_wrapper=self._client_wrapper)
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: MurfEnvironment) -> str:
|
|
151
|
-
if base_url is not None:
|
|
152
|
-
return base_url
|
|
153
|
-
elif environment is not None:
|
|
154
|
-
return environment.value
|
|
155
|
-
else:
|
|
156
|
-
raise Exception("Please pass in either base_url or environment to construct the client")
|
|
@@ -3,6 +3,7 @@ from .environment import MurfEnvironment
|
|
|
3
3
|
import typing
|
|
4
4
|
import os
|
|
5
5
|
import httpx
|
|
6
|
+
from .version import __version__
|
|
6
7
|
|
|
7
8
|
class Murf(BaseClient):
|
|
8
9
|
"""
|
|
@@ -10,8 +11,6 @@ class Murf(BaseClient):
|
|
|
10
11
|
|
|
11
12
|
Parameters
|
|
12
13
|
----------
|
|
13
|
-
base_url : typing.Optional[str]
|
|
14
|
-
The base url to use for requests from the client.
|
|
15
14
|
|
|
16
15
|
environment : MurfEnvironment
|
|
17
16
|
The environment to use for requests from the client. from .environment import MurfEnvironment
|
|
@@ -44,15 +43,17 @@ class Murf(BaseClient):
|
|
|
44
43
|
def __init__(
|
|
45
44
|
self,
|
|
46
45
|
*,
|
|
47
|
-
base_url: typing.Optional[str] = None,
|
|
48
46
|
environment: MurfEnvironment = MurfEnvironment.DEFAULT,
|
|
49
47
|
api_key: typing.Optional[str] = os.getenv("MURF_API_KEY"),
|
|
50
48
|
timeout: typing.Optional[float] = 60,
|
|
51
49
|
follow_redirects: typing.Optional[bool] = True,
|
|
52
50
|
httpx_client: typing.Optional[httpx.Client] = None,
|
|
53
51
|
):
|
|
52
|
+
default_params = {'origin': f'python_sdk_{__version__}'}
|
|
53
|
+
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
|
|
54
|
+
httpx_client=httpx_client if httpx_client is not None else httpx.Client(params=default_params, timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.Client(params=default_params, timeout=_defaulted_timeout)
|
|
55
|
+
|
|
54
56
|
super().__init__(
|
|
55
|
-
base_url=base_url,
|
|
56
57
|
environment=environment,
|
|
57
58
|
api_key=api_key,
|
|
58
59
|
timeout=timeout,
|
|
@@ -68,8 +69,6 @@ class AsyncMurf(AsyncBaseClient):
|
|
|
68
69
|
|
|
69
70
|
Parameters
|
|
70
71
|
----------
|
|
71
|
-
base_url : typing.Optional[str]
|
|
72
|
-
The base url to use for requests from the client.
|
|
73
72
|
|
|
74
73
|
environment : MurfEnvironment
|
|
75
74
|
The environment to use for requests from the client. from .environment import MurfEnvironment
|
|
@@ -102,15 +101,17 @@ class AsyncMurf(AsyncBaseClient):
|
|
|
102
101
|
def __init__(
|
|
103
102
|
self,
|
|
104
103
|
*,
|
|
105
|
-
base_url: typing.Optional[str] = None,
|
|
106
104
|
environment: MurfEnvironment = MurfEnvironment.DEFAULT,
|
|
107
105
|
api_key: typing.Optional[str] = os.getenv("MURF_API_KEY"),
|
|
108
106
|
timeout: typing.Optional[float] = 60,
|
|
109
107
|
follow_redirects: typing.Optional[bool] = True,
|
|
110
108
|
httpx_client: typing.Optional[httpx.AsyncClient] = None,
|
|
111
109
|
):
|
|
110
|
+
default_params = {'origin': f'python_sdk_{__version__}'}
|
|
111
|
+
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
|
|
112
|
+
httpx_client=httpx_client if httpx_client is not None else httpx.AsyncClient(params=default_params, timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.AsyncClient(params=default_params, timeout=_defaulted_timeout)
|
|
113
|
+
|
|
112
114
|
super().__init__(
|
|
113
|
-
base_url=base_url,
|
|
114
115
|
environment=environment,
|
|
115
116
|
api_key=api_key,
|
|
116
117
|
timeout=timeout,
|
|
@@ -19,6 +19,7 @@ from .query_encoder import encode_query
|
|
|
19
19
|
from .remove_none_from_dict import remove_none_from_dict
|
|
20
20
|
from .request_options import RequestOptions
|
|
21
21
|
from .serialization import FieldMetadata, convert_and_respect_annotation_metadata
|
|
22
|
+
from .unchecked_base_model import UncheckedBaseModel, UnionMetadata, construct_type
|
|
22
23
|
|
|
23
24
|
__all__ = [
|
|
24
25
|
"ApiError",
|
|
@@ -31,8 +32,11 @@ __all__ = [
|
|
|
31
32
|
"IS_PYDANTIC_V2",
|
|
32
33
|
"RequestOptions",
|
|
33
34
|
"SyncClientWrapper",
|
|
35
|
+
"UncheckedBaseModel",
|
|
36
|
+
"UnionMetadata",
|
|
34
37
|
"UniversalBaseModel",
|
|
35
38
|
"UniversalRootModel",
|
|
39
|
+
"construct_type",
|
|
36
40
|
"convert_and_respect_annotation_metadata",
|
|
37
41
|
"convert_file_dict_to_httpx_tuples",
|
|
38
42
|
"encode_query",
|
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
|
+
from ..environment import MurfEnvironment
|
|
4
5
|
import httpx
|
|
5
6
|
from .http_client import HttpClient
|
|
6
7
|
from .http_client import AsyncHttpClient
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class BaseClientWrapper:
|
|
10
|
-
def __init__(
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
*,
|
|
14
|
+
api_key: typing.Optional[str] = None,
|
|
15
|
+
environment: MurfEnvironment,
|
|
16
|
+
timeout: typing.Optional[float] = None,
|
|
17
|
+
):
|
|
11
18
|
self._api_key = api_key
|
|
12
|
-
self.
|
|
19
|
+
self._environment = environment
|
|
13
20
|
self._timeout = timeout
|
|
14
21
|
|
|
15
22
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
16
23
|
headers: typing.Dict[str, str] = {
|
|
17
24
|
"X-Fern-Language": "Python",
|
|
18
25
|
"X-Fern-SDK-Name": "murf",
|
|
19
|
-
"X-Fern-SDK-Version": "
|
|
26
|
+
"X-Fern-SDK-Version": "2.0.0",
|
|
20
27
|
}
|
|
21
28
|
if self._api_key is not None:
|
|
22
29
|
headers["api-key"] = self._api_key
|
|
23
30
|
return headers
|
|
24
31
|
|
|
25
|
-
def
|
|
26
|
-
return self.
|
|
32
|
+
def get_environment(self) -> MurfEnvironment:
|
|
33
|
+
return self._environment
|
|
27
34
|
|
|
28
35
|
def get_timeout(self) -> typing.Optional[float]:
|
|
29
36
|
return self._timeout
|
|
@@ -34,16 +41,13 @@ class SyncClientWrapper(BaseClientWrapper):
|
|
|
34
41
|
self,
|
|
35
42
|
*,
|
|
36
43
|
api_key: typing.Optional[str] = None,
|
|
37
|
-
|
|
44
|
+
environment: MurfEnvironment,
|
|
38
45
|
timeout: typing.Optional[float] = None,
|
|
39
46
|
httpx_client: httpx.Client,
|
|
40
47
|
):
|
|
41
|
-
super().__init__(api_key=api_key,
|
|
48
|
+
super().__init__(api_key=api_key, environment=environment, timeout=timeout)
|
|
42
49
|
self.httpx_client = HttpClient(
|
|
43
|
-
httpx_client=httpx_client,
|
|
44
|
-
base_headers=self.get_headers,
|
|
45
|
-
base_timeout=self.get_timeout,
|
|
46
|
-
base_url=self.get_base_url,
|
|
50
|
+
httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout
|
|
47
51
|
)
|
|
48
52
|
|
|
49
53
|
|
|
@@ -52,14 +56,11 @@ class AsyncClientWrapper(BaseClientWrapper):
|
|
|
52
56
|
self,
|
|
53
57
|
*,
|
|
54
58
|
api_key: typing.Optional[str] = None,
|
|
55
|
-
|
|
59
|
+
environment: MurfEnvironment,
|
|
56
60
|
timeout: typing.Optional[float] = None,
|
|
57
61
|
httpx_client: httpx.AsyncClient,
|
|
58
62
|
):
|
|
59
|
-
super().__init__(api_key=api_key,
|
|
63
|
+
super().__init__(api_key=api_key, environment=environment, timeout=timeout)
|
|
60
64
|
self.httpx_client = AsyncHttpClient(
|
|
61
|
-
httpx_client=httpx_client,
|
|
62
|
-
base_headers=self.get_headers,
|
|
63
|
-
base_timeout=self.get_timeout,
|
|
64
|
-
base_url=self.get_base_url,
|
|
65
|
+
httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout
|
|
65
66
|
)
|