generated from deepgram/oss-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 71
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
dvonthenen
committed
Nov 9, 2023
1 parent
13e734f
commit 74ae8a6
Showing
14 changed files
with
45 additions
and
91 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
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
*.egg-info | ||
*/__pycache__/ | ||
__pycache__ | ||
dist/ | ||
.venv | ||
.env | ||
venv/ | ||
venv.bak/ | ||
build/ |
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 |
---|---|---|
@@ -1,29 +1,17 @@ | ||
from deepgram.deepgram_client import DeepgramClient | ||
from .types.deepgram_client_options import DeepgramClientOptions | ||
|
||
def create_client(api_key: str, config_options: DeepgramClientOptions = None) -> DeepgramClient: | ||
""" | ||
Create a DeepgramClient instance with the provided API key and optional configuration options. | ||
This function initializes and returns a DeepgramClient instance, which can be used to interact with the Deepgram API. You can provide an API key for authentication and customize the client's configuration by passing a DeepgramClientOptions object. | ||
# version | ||
__version__ = '0.0.0' | ||
|
||
Args: | ||
api_key (str): The Deepgram API key used for authentication. | ||
config_options (DeepgramClientOptions, optional): An optional configuration object specifying client options. If not provided, the default settings will be used. | ||
Returns: | ||
DeepgramClient: An instance of the DeepgramClient class for making requests to the Deepgram API. | ||
Example usage: | ||
To create a DeepgramClient instance with a custom configuration: | ||
# entry point for the deepgram python sdk | ||
from .deepgram_client import DeepgramClient | ||
from .types.deepgram_client_options import DeepgramClientOptions | ||
from .errors import DeepgramError, DeepgramApiError, DeepgramUnknownApiError, DeepgramUnknownError | ||
|
||
>>> api_key = "your_api_key" | ||
>>> custom_options = DeepgramClientOptions(global_options={"url": "custom_url", "headers": {"Custom-Header": "value"}}) | ||
>>> client = create_client(api_key, config_options=custom_options) | ||
# live | ||
from .types.transcription_options import LiveOptions | ||
from .enums import LiveTranscriptionEvents | ||
|
||
Example usage with default settings: | ||
# prerecorded | ||
from .types.transcription_options import PrerecordedOptions | ||
|
||
>>> api_key = "your_api_key" | ||
>>> client = create_client(api_key) | ||
""" | ||
return DeepgramClient(api_key, config_options) | ||
# manage | ||
from .clients.manage_client import ManageClient |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
|
||
|
||
class DeepgramError(Exception): | ||
""" | ||
Base class for exceptions raised by the Deepgram API client. | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-e ../../ | ||
-e ../ | ||
httpx | ||
typing_extensions | ||
python-dotenv |
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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "deepgram-sdk" | ||
dynamic = ["version"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "deepgram.__version__"} |
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