Skip to content

Commit

Permalink
Merge pull request #80 from deepgram/feature-parity
Browse files Browse the repository at this point in the history
updated types, update parameters for update projects and create key f…
  • Loading branch information
briancbarrow authored Apr 12, 2023
2 parents 50ac111 + b5defad commit 132acde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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

0 comments on commit 132acde

Please sign in to comment.