Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deepgram/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class TranscriptionOptions(TypedDict, total=False):
measurements: bool
smart_format: bool
replace: str
tag: List[str]


class PrerecordedOptions(TranscriptionOptions, total=False):
Expand All @@ -93,6 +94,7 @@ class PrerecordedOptions(TranscriptionOptions, total=False):
detect_topics: bool
translate: List[str]
analyze_sentiment: bool
sentiment: bool
sentiment_threshold: float


Expand Down
6 changes: 3 additions & 3 deletions deepgram/keys.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List
from ._types import Options, Key, KeyResponse
from ._utils import _request

import datetime

class Keys:
_root = "/projects"
Expand All @@ -22,12 +22,12 @@ async def get(self, project_id: str, key: str) -> Key:
)

async def create(
self, project_id: str, comment: str, scopes: List[str]
self, project_id: str, comment: str, scopes: List[str], tags: List[str], expiration_date: datetime, time_to_live_in_seconds: int
) -> Key:
"""Creates an API key with the provided scopes."""
return await _request(
f'{self._root}/{project_id}/keys', self.options,
method='POST', payload={'comment': comment, 'scopes': scopes},
method='POST', payload={'comment': comment, 'scopes': scopes, 'tags': tags, 'expiration_date': expiration_date, 'time_to_live_in_seconds': time_to_live_in_seconds},
headers={'Content-Type': 'application/json'}
)

Expand Down