Skip to content

Commit 83f320f

Browse files
Fix CreateKey Response in Manage API
1 parent 4fa26b3 commit 83f320f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

deepgram/clients/manage/v1/response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ def __str__(self) -> str:
116116
@dataclass
117117
class Key:
118118
api_key_id: str = ""
119+
key: Optional[str] = field(
120+
default=None, metadata=config(exclude=lambda f: f is None)
121+
)
119122
comment: Optional[str] = ""
120123
created: str = ""
121124
scopes: List[str] = None

examples/manage/keys/main.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44

55
import os
66
import sys
7+
import logging, verboselogs
78
from dotenv import load_dotenv
89

9-
from deepgram import DeepgramClient, KeyOptions
10+
from deepgram import DeepgramClient, DeepgramClientOptions, KeyOptions
1011

1112
load_dotenv()
1213

1314

1415
def main():
1516
try:
16-
# Create a Deepgram client using the API key
17-
deepgram: DeepgramClient = DeepgramClient()
17+
# example of setting up a client config. logging values: WARNING, VERBOSE, DEBUG, SPAM
18+
config = DeepgramClientOptions(
19+
verbose=logging.DEBUG,
20+
)
21+
deepgram: DeepgramClient = DeepgramClient("", config)
22+
# otherwise, use default config
23+
# deepgram: DeepgramClient = DeepgramClient()
1824

1925
# get projects
2026
projectResp = deepgram.manage.v("1").get_projects()

0 commit comments

Comments
 (0)