Skip to content

Commit b7534e2

Browse files
dubbing client
1 parent 685d343 commit b7534e2

File tree

2 files changed

+123
-1
lines changed

2 files changed

+123
-1
lines changed

src/murf/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def __init__(
5959
follow_redirects=follow_redirects,
6060
httpx_client=httpx_client
6161
)
62+
self.dubbing = None
6263

6364

6465
class AsyncMurf(AsyncBaseClient):
@@ -115,4 +116,5 @@ def __init__(
115116
timeout=timeout,
116117
follow_redirects=follow_redirects,
117118
httpx_client=httpx_client
118-
)
119+
)
120+
self.dubbing = None

src/murf/dubbing_client.py

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
from .base_client import BaseClient, AsyncBaseClient
2+
from .environment import MurfEnvironment
3+
import typing
4+
import os
5+
import httpx
6+
7+
class MurfDub(BaseClient):
8+
"""
9+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
10+
11+
Parameters
12+
----------
13+
base_url : typing.Optional[str]
14+
The base url to use for requests from the client.
15+
16+
environment : MurfEnvironment
17+
The environment to use for requests from the client. from .environment import MurfEnvironment
18+
19+
20+
21+
Defaults to MurfEnvironment.DEFAULT
22+
23+
24+
25+
api_key : typing.Optional[str]
26+
timeout : typing.Optional[float]
27+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
28+
29+
follow_redirects : typing.Optional[bool]
30+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
31+
32+
httpx_client : typing.Optional[httpx.Client]
33+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
34+
35+
Examples
36+
--------
37+
from murf import MurfDub
38+
39+
client = MurfDub(
40+
api_key="YOUR_API_KEY",
41+
)
42+
"""
43+
44+
def __init__(
45+
self,
46+
*,
47+
base_url: typing.Optional[str] = None,
48+
environment: MurfEnvironment = MurfEnvironment.DEFAULT,
49+
api_key: typing.Optional[str] = os.getenv("MURFDUB_API_KEY"),
50+
timeout: typing.Optional[float] = 60,
51+
follow_redirects: typing.Optional[bool] = True,
52+
httpx_client: typing.Optional[httpx.Client] = None,
53+
):
54+
super().__init__(
55+
base_url=base_url,
56+
environment=environment,
57+
api_key=api_key,
58+
timeout=timeout,
59+
follow_redirects=follow_redirects,
60+
httpx_client=httpx_client
61+
)
62+
self.text_to_speech = None
63+
64+
65+
class AsyncMurfDub(AsyncBaseClient):
66+
"""
67+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
68+
69+
Parameters
70+
----------
71+
base_url : typing.Optional[str]
72+
The base url to use for requests from the client.
73+
74+
environment : MurfEnvironment
75+
The environment to use for requests from the client. from .environment import MurfEnvironment
76+
77+
78+
79+
Defaults to MurfEnvironment.DEFAULT
80+
81+
82+
83+
api_key : typing.Optional[str]
84+
timeout : typing.Optional[float]
85+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
86+
87+
follow_redirects : typing.Optional[bool]
88+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
89+
90+
httpx_client : typing.Optional[httpx.AsyncClient]
91+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
92+
93+
Examples
94+
--------
95+
from murf import AsyncMurfDub
96+
97+
client = AsyncMurfDub(
98+
api_key="YOUR_API_KEY",
99+
)
100+
"""
101+
102+
def __init__(
103+
self,
104+
*,
105+
base_url: typing.Optional[str] = None,
106+
environment: MurfEnvironment = MurfEnvironment.DEFAULT,
107+
api_key: typing.Optional[str] = os.getenv("MURFDUB_API_KEY"),
108+
timeout: typing.Optional[float] = 60,
109+
follow_redirects: typing.Optional[bool] = True,
110+
httpx_client: typing.Optional[httpx.AsyncClient] = None,
111+
):
112+
super().__init__(
113+
base_url=base_url,
114+
environment=environment,
115+
api_key=api_key,
116+
timeout=timeout,
117+
follow_redirects=follow_redirects,
118+
httpx_client=httpx_client
119+
)
120+
self.text_to_speech = None

0 commit comments

Comments
 (0)