-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,411 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ dist/ | |
.env_private | ||
scripts/ | ||
.cache/ | ||
output.wav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from cozepy import Auth | ||
from cozepy.request import Requester | ||
from cozepy.util import http_base_url_to_ws, remove_url_trailing_slash | ||
|
||
from .audio import AsyncWebsocketsAudioClient | ||
from .chat import AsyncWebsocketsChatClient | ||
|
||
|
||
class AsyncWebsocketsClient(object): | ||
def __init__(self, base_url: str, auth: Auth, requester: Requester): | ||
self._base_url = http_base_url_to_ws(remove_url_trailing_slash(base_url)) | ||
self._auth = auth | ||
self._requester = requester | ||
|
||
@property | ||
def audio(self) -> AsyncWebsocketsAudioClient: | ||
return AsyncWebsocketsAudioClient( | ||
base_url=self._base_url, | ||
auth=self._auth, | ||
requester=self._requester, | ||
) | ||
|
||
@property | ||
def chat(self) -> AsyncWebsocketsChatClient: | ||
return AsyncWebsocketsChatClient( | ||
base_url=self._base_url, | ||
auth=self._auth, | ||
requester=self._requester, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from cozepy.auth import Auth | ||
from cozepy.request import Requester | ||
|
||
from .speech import AsyncWebsocketsAudioSpeechClient | ||
from .transcriptions import AsyncWebsocketsAudioTranscriptionsClient | ||
|
||
|
||
class AsyncWebsocketsAudioClient(object): | ||
def __init__(self, base_url: str, auth: Auth, requester: Requester): | ||
self._base_url = base_url | ||
self._auth = auth | ||
self._requester = requester | ||
|
||
@property | ||
def transcriptions(self) -> "AsyncWebsocketsAudioTranscriptionsClient": | ||
return AsyncWebsocketsAudioTranscriptionsClient( | ||
base_url=self._base_url, | ||
auth=self._auth, | ||
requester=self._requester, | ||
) | ||
|
||
@property | ||
def speech(self) -> "AsyncWebsocketsAudioSpeechClient": | ||
return AsyncWebsocketsAudioSpeechClient( | ||
base_url=self._base_url, | ||
auth=self._auth, | ||
requester=self._requester, | ||
) |
Oops, something went wrong.