Skip to content

Commit 601c558

Browse files
authored
Merge pull request #507 from deepgram/revert/keyterms
revert: keyterm -> keyterms
2 parents 32111c2 + d647d63 commit 601c558

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

deepgram/clients/agent/v1/websocket/async_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ async def start(
225225
else:
226226
raise DeepgramError("Invalid options type")
227227

228+
if self._settings.agent.listen.keyterms is not None and self._settings.agent.listen.model is not None and not self._settings.agent.listen.model.startswith("nova-3"):
229+
raise DeepgramError("Keyterms are only supported for nova-3 models")
230+
228231
try:
229232
# speaker substitutes the listening thread
230233
if self._speaker is not None:

deepgram/clients/agent/v1/websocket/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ def start(
226226
else:
227227
raise DeepgramError("Invalid options type")
228228

229+
if self._settings.agent.listen.keyterms is not None and self._settings.agent.listen.model is not None and not self._settings.agent.listen.model.startswith("nova-3"):
230+
raise DeepgramError("Keyterms are only supported for nova-3 models")
231+
229232
try:
230233
# speaker substitutes the listening thread
231234
if self._speaker is not None:

deepgram/clients/agent/v1/websocket/options.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class Listen(BaseResponse):
2626
model: Optional[str] = field(
2727
default=None, metadata=dataclass_config(exclude=lambda f: f is None)
2828
)
29+
keyterms: Optional[List[str]] = field(
30+
default=None, metadata=dataclass_config(exclude=lambda f: f is None)
31+
)
2932

3033

3134
@dataclass

examples/agent/simple/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ def on_unhandled(self, unhandled, **kwargs):
136136

137137
# connect to websocket
138138
options: SettingsConfigurationOptions = SettingsConfigurationOptions()
139+
options.agent.listen.model = "nova-3"
140+
options.agent.listen.keyterms = ["hello", "goodbye"]
139141
options.agent.think.provider.type = "open_ai"
140142
options.agent.think.model = "gpt-4o-mini"
141143
options.agent.think.instructions = "You are a helpful AI assistant."

0 commit comments

Comments
 (0)