Skip to content

Commit 30fdca1

Browse files
committed
Release 2.0.1
1 parent f21a904 commit 30fdca1

21 files changed

+255
-72
lines changed

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "murf"
33

44
[tool.poetry]
55
name = "murf"
6-
version = "2.0.0"
6+
version = "2.0.1"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ client.text_to_speech.generate(
154154
<dl>
155155
<dd>
156156

157-
**format:** `typing.Optional[str]` — Format of the generated audio file. Valid values: MP3, WAV, FLAC, ALAW, ULAW
157+
**format:** `typing.Optional[str]` — Format of the generated audio file. Valid values: MP3, WAV, FLAC, ALAW, ULAW, PCM, OGG
158158

159159
</dd>
160160
</dl>
@@ -235,6 +235,14 @@ An object used to define custom pronunciations.
235235
<dl>
236236
<dd>
237237

238+
**word_durations_as_original_text:** `typing.Optional[bool]` — If set to true, the word durations in response will return words as the original input text. (English only)
239+
240+
</dd>
241+
</dl>
242+
243+
<dl>
244+
<dd>
245+
238246
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
239247

240248
</dd>
@@ -319,7 +327,7 @@ client.text_to_speech.stream()
319327
<dl>
320328
<dd>
321329

322-
**format:** `typing.Optional[str]` — Format of the generated audio file. Valid values: MP3, WAV
330+
**format:** `typing.Optional[str]` — Format of the generated audio file. Valid values: MP3, WAV, PCM
323331

324332
</dd>
325333
</dl>
@@ -346,6 +354,20 @@ Valid values: "en-US", "en-UK", "es-ES", etc. Use the GET /v1/speech/voices endp
346354
<dl>
347355
<dd>
348356

357+
**pronunciation_dictionary:** `typing.Optional[typing.Dict[str, PronunciationDetail]]`
358+
359+
An object used to define custom pronunciations.
360+
361+
Example 1: {"live":{"type": "IPA", "pronunciation": "laɪv"}}.
362+
363+
Example 2: {"2022":{"type": "SAY_AS", "pronunciation": "twenty twenty two"}}
364+
365+
</dd>
366+
</dl>
367+
368+
<dl>
369+
<dd>
370+
349371
**rate:** `typing.Optional[int]` — Speed of the voiceover
350372

351373
</dd>
@@ -557,7 +579,9 @@ from murf import Murf
557579
client = Murf(
558580
api_key="YOUR_API_KEY",
559581
)
560-
client.voice_changer.convert()
582+
client.voice_changer.convert(
583+
voice_id="voice_id",
584+
)
561585

562586
```
563587
</dd>
@@ -573,6 +597,14 @@ client.voice_changer.convert()
573597
<dl>
574598
<dd>
575599

600+
**voice_id:** `str` — Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor's name (e.g. natalie).
601+
602+
</dd>
603+
</dl>
604+
605+
<dl>
606+
<dd>
607+
576608
**audio_duration:** `typing.Optional[float]` — This parameter allows specifying the duration (in seconds) for the generated audio. If the value is 0, this parameter will be ignored. Only available for Gen2 model.
577609

578610
</dd>
@@ -722,14 +754,6 @@ Example 2: '{"2022": {"type": "SAY_AS", "pronunciation": "twenty twenty two"}}'
722754
<dl>
723755
<dd>
724756

725-
**voice_id:** `typing.Optional[str]` — Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor's name (e.g. natalie).
726-
727-
</dd>
728-
</dl>
729-
730-
<dl>
731-
<dd>
732-
733757
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
734758

735759
</dd>

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
httpx>=0.21.2
2+
pydantic>= 1.9.2
3+
pydantic-core==^2.18.2
4+
typing_extensions>= 4.0.0

src/murf/__init__.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@
2525
PronunciationDetail,
2626
PronunciationDetailType,
2727
SendText,
28+
SendTextVoiceConfig,
29+
SendTextVoiceConfigPronunciationDictionaryValue,
30+
SendTextVoiceConfigPronunciationDictionaryValueType,
2831
SetAdvancedSettings,
29-
SetVoiceConfiguration,
30-
SetVoiceConfigurationVoiceConfig,
31-
SetVoiceConfigurationVoiceConfigPronunciationDictionaryValue,
32-
SetVoiceConfigurationVoiceConfigPronunciationDictionaryValueType,
32+
SetVoiceConfigurationOrInitializeContext,
33+
SetVoiceConfigurationOrInitializeContextVoiceConfig,
34+
SetVoiceConfigurationOrInitializeContextVoiceConfigPronunciationDictionaryValue,
35+
SetVoiceConfigurationOrInitializeContextVoiceConfigPronunciationDictionaryValueType,
3336
SourceLocaleResponse,
3437
SpeechToSpeechResponse,
3538
StyleDetails,
@@ -92,12 +95,15 @@
9295
"ReceiveMessage",
9396
"SendMessage",
9497
"SendText",
98+
"SendTextVoiceConfig",
99+
"SendTextVoiceConfigPronunciationDictionaryValue",
100+
"SendTextVoiceConfigPronunciationDictionaryValueType",
95101
"ServiceUnavailableError",
96102
"SetAdvancedSettings",
97-
"SetVoiceConfiguration",
98-
"SetVoiceConfigurationVoiceConfig",
99-
"SetVoiceConfigurationVoiceConfigPronunciationDictionaryValue",
100-
"SetVoiceConfigurationVoiceConfigPronunciationDictionaryValueType",
103+
"SetVoiceConfigurationOrInitializeContext",
104+
"SetVoiceConfigurationOrInitializeContextVoiceConfig",
105+
"SetVoiceConfigurationOrInitializeContextVoiceConfigPronunciationDictionaryValue",
106+
"SetVoiceConfigurationOrInitializeContextVoiceConfigPronunciationDictionaryValueType",
101107
"SourceLocaleResponse",
102108
"SpeechToSpeechResponse",
103109
"StyleDetails",

src/murf/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_headers(self) -> typing.Dict[str, str]:
2323
headers: typing.Dict[str, str] = {
2424
"X-Fern-Language": "Python",
2525
"X-Fern-SDK-Name": "murf",
26-
"X-Fern-SDK-Version": "2.0.0",
26+
"X-Fern-SDK-Version": "2.0.1",
2727
}
2828
if self._api_key is not None:
2929
headers["api-key"] = self._api_key

src/murf/core/http_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def _retry_timeout(response: httpx.Response, retries: int) -> float:
8585

8686

8787
def _should_retry(response: httpx.Response) -> bool:
88-
retriable_400s = [429, 408, 409]
89-
return response.status_code >= 500 or response.status_code in retriable_400s
88+
retryable_400s = [429, 408, 409]
89+
return response.status_code >= 500 or response.status_code in retryable_400s
9090

9191

9292
def remove_omit_from_dict(
@@ -183,7 +183,7 @@ def request(
183183
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
184184
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
185185
request_options: typing.Optional[RequestOptions] = None,
186-
retries: int = 0,
186+
retries: int = 2,
187187
omit: typing.Optional[typing.Any] = None,
188188
) -> httpx.Response:
189189
base_url = self.get_base_url(base_url)
@@ -269,7 +269,7 @@ def stream(
269269
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
270270
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
271271
request_options: typing.Optional[RequestOptions] = None,
272-
retries: int = 0,
272+
retries: int = 2,
273273
omit: typing.Optional[typing.Any] = None,
274274
) -> typing.Iterator[httpx.Response]:
275275
base_url = self.get_base_url(base_url)
@@ -359,7 +359,7 @@ async def request(
359359
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
360360
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
361361
request_options: typing.Optional[RequestOptions] = None,
362-
retries: int = 0,
362+
retries: int = 2,
363363
omit: typing.Optional[typing.Any] = None,
364364
) -> httpx.Response:
365365
base_url = self.get_base_url(base_url)
@@ -445,7 +445,7 @@ async def stream(
445445
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
446446
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
447447
request_options: typing.Optional[RequestOptions] = None,
448-
retries: int = 0,
448+
retries: int = 2,
449449
omit: typing.Optional[typing.Any] = None,
450450
) -> typing.AsyncIterator[httpx.Response]:
451451
base_url = self.get_base_url(base_url)

src/murf/core/pydantic_utilities.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def to_jsonable_with_fallback(
7979
class UniversalBaseModel(pydantic.BaseModel):
8080
if IS_PYDANTIC_V2:
8181
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
82-
# Allow fields begining with `model_` to be used in the model
82+
# Allow fields beginning with `model_` to be used in the model
8383
protected_namespaces=(),
8484
) # type: ignore # Pydantic v2
8585

@@ -128,7 +128,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
128128
Override the default dict method to `exclude_unset` by default. This function patches
129129
`exclude_unset` to work include fields within non-None default values.
130130
"""
131-
# Note: the logic here is multi-plexed given the levers exposed in Pydantic V1 vs V2
131+
# Note: the logic here is multiplexed given the levers exposed in Pydantic V1 vs V2
132132
# Pydantic V1's .dict can be extremely slow, so we do not want to call it twice.
133133
#
134134
# We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# This file was auto-generated by Fern from our API Definition.
22

33
import typing
4-
from ...types.set_voice_configuration import SetVoiceConfiguration
4+
from ...types.set_voice_configuration_or_initialize_context import SetVoiceConfigurationOrInitializeContext
55
from ...types.send_text import SendText
66
from ...types.set_advanced_settings import SetAdvancedSettings
77
from ...types.clear_context import ClearContext
88

9-
SendMessage = typing.Union[SetVoiceConfiguration, SendText, SetAdvancedSettings, ClearContext]
9+
SendMessage = typing.Union[SetVoiceConfigurationOrInitializeContext, SendText, SetAdvancedSettings, ClearContext]

0 commit comments

Comments
 (0)