Skip to content

Commit f998ecf

Browse files
Add Convenience Alias for speak.file()
1 parent 4fa26b3 commit f998ecf

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

deepgram/clients/speak/v1/async_client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ async def stream(
108108
self.logger.debug("AsyncSpeakClient.stream LEAVE")
109109
return sResp
110110

111+
async def file(
112+
self,
113+
filename: str,
114+
source: SpeakSource,
115+
options: Optional[Union[Dict, SpeakOptions]] = None,
116+
addons: Optional[Dict] = None,
117+
timeout: Optional[httpx.Timeout] = None,
118+
endpoint: str = "v1/speak",
119+
) -> SpeakResponse:
120+
return await self.save(filename, source, options, addons, timeout, endpoint)
121+
111122
async def save(
112123
self,
113124
filename: str,

deepgram/clients/speak/v1/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ def stream(
107107
self.logger.debug("SpeakClient.stream LEAVE")
108108
return sResp
109109

110+
async def file(
111+
self,
112+
filename: str,
113+
source: SpeakSource,
114+
options: Optional[Union[Dict, SpeakOptions]] = None,
115+
addons: Optional[Dict] = None,
116+
timeout: Optional[httpx.Timeout] = None,
117+
endpoint: str = "v1/speak",
118+
) -> SpeakResponse:
119+
return self.save(filename, source, options, addons, timeout, endpoint)
120+
110121
def save(
111122
self,
112123
filename: str,

0 commit comments

Comments
 (0)