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
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"skip_validation": true
}
},
"originGitCommit": "0825695d67503a2d95eda2ecb88672d7ee6aa4d6",
"originGitCommit": "11cbef1122366ca086b021f14a892414ffcc035d",
"originGitCommitIsDirty": true,
"invokedBy": "manual",
"sdkVersion": "7.9.0"
}
"sdkVersion": "7.9.1"
}
1,088 changes: 582 additions & 506 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "deepgram-sdk"
version = "7.9.0"
version = "7.9.1"
description = ""
readme = "README.md"
authors = []
Expand Down
2 changes: 2 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6169,6 +6169,7 @@ from deepgram.agent.v1.types import (
AgentV1UserStartedSpeaking,
AgentV1AgentThinking,
AgentV1FunctionCallRequest,
AgentV1FunctionCallCancelled,
AgentV1AgentStartedSpeaking,
AgentV1AgentAudioDone,
AgentV1Error,
Expand Down Expand Up @@ -6277,6 +6278,7 @@ from deepgram.agent.v1.types import (
AgentV1UserStartedSpeaking,
AgentV1AgentThinking,
AgentV1FunctionCallRequest,
AgentV1FunctionCallCancelled,
AgentV1AgentStartedSpeaking,
AgentV1AgentAudioDone,
AgentV1Error,
Expand Down
12 changes: 12 additions & 0 deletions src/deepgram/agent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
AgentV1ErrorParams,
AgentV1ForceEndTurn,
AgentV1ForceEndTurnParams,
AgentV1FunctionCallCancelled,
AgentV1FunctionCallCancelledFunctionsItem,
AgentV1FunctionCallCancelledFunctionsItemParams,
AgentV1FunctionCallCancelledParams,
AgentV1FunctionCallRequest,
AgentV1FunctionCallRequestFunctionsItem,
AgentV1FunctionCallRequestFunctionsItemParams,
Expand Down Expand Up @@ -176,6 +180,10 @@
"AgentV1ErrorParams": ".v1",
"AgentV1ForceEndTurn": ".v1",
"AgentV1ForceEndTurnParams": ".v1",
"AgentV1FunctionCallCancelled": ".v1",
"AgentV1FunctionCallCancelledFunctionsItem": ".v1",
"AgentV1FunctionCallCancelledFunctionsItemParams": ".v1",
"AgentV1FunctionCallCancelledParams": ".v1",
"AgentV1FunctionCallRequest": ".v1",
"AgentV1FunctionCallRequestFunctionsItem": ".v1",
"AgentV1FunctionCallRequestFunctionsItemParams": ".v1",
Expand Down Expand Up @@ -353,6 +361,10 @@ def __dir__():
"AgentV1ErrorParams",
"AgentV1ForceEndTurn",
"AgentV1ForceEndTurnParams",
"AgentV1FunctionCallCancelled",
"AgentV1FunctionCallCancelledFunctionsItem",
"AgentV1FunctionCallCancelledFunctionsItemParams",
"AgentV1FunctionCallCancelledParams",
"AgentV1FunctionCallRequest",
"AgentV1FunctionCallRequestFunctionsItem",
"AgentV1FunctionCallRequestFunctionsItemParams",
Expand Down
12 changes: 12 additions & 0 deletions src/deepgram/agent/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
AgentV1ConversationTextRole,
AgentV1Error,
AgentV1ForceEndTurn,
AgentV1FunctionCallCancelled,
AgentV1FunctionCallCancelledFunctionsItem,
AgentV1FunctionCallRequest,
AgentV1FunctionCallRequestFunctionsItem,
AgentV1History,
Expand Down Expand Up @@ -80,6 +82,8 @@
AgentV1ConversationTextParams,
AgentV1ErrorParams,
AgentV1ForceEndTurnParams,
AgentV1FunctionCallCancelledFunctionsItemParams,
AgentV1FunctionCallCancelledParams,
AgentV1FunctionCallRequestFunctionsItemParams,
AgentV1FunctionCallRequestParams,
AgentV1HistoryParams,
Expand Down Expand Up @@ -180,6 +184,10 @@
"AgentV1ErrorParams": ".requests",
"AgentV1ForceEndTurn": ".types",
"AgentV1ForceEndTurnParams": ".requests",
"AgentV1FunctionCallCancelled": ".types",
"AgentV1FunctionCallCancelledFunctionsItem": ".types",
"AgentV1FunctionCallCancelledFunctionsItemParams": ".requests",
"AgentV1FunctionCallCancelledParams": ".requests",
"AgentV1FunctionCallRequest": ".types",
"AgentV1FunctionCallRequestFunctionsItem": ".types",
"AgentV1FunctionCallRequestFunctionsItemParams": ".requests",
Expand Down Expand Up @@ -357,6 +365,10 @@ def __dir__():
"AgentV1ErrorParams",
"AgentV1ForceEndTurn",
"AgentV1ForceEndTurnParams",
"AgentV1FunctionCallCancelled",
"AgentV1FunctionCallCancelledFunctionsItem",
"AgentV1FunctionCallCancelledFunctionsItemParams",
"AgentV1FunctionCallCancelledParams",
"AgentV1FunctionCallRequest",
"AgentV1FunctionCallRequestFunctionsItem",
"AgentV1FunctionCallRequestFunctionsItemParams",
Expand Down
6 changes: 6 additions & 0 deletions src/deepgram/agent/v1/requests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from .agent_v1conversation_text import AgentV1ConversationTextParams
from .agent_v1error import AgentV1ErrorParams
from .agent_v1force_end_turn import AgentV1ForceEndTurnParams
from .agent_v1function_call_cancelled import AgentV1FunctionCallCancelledParams
from .agent_v1function_call_cancelled_functions_item import AgentV1FunctionCallCancelledFunctionsItemParams
from .agent_v1function_call_request import AgentV1FunctionCallRequestParams
from .agent_v1function_call_request_functions_item import AgentV1FunctionCallRequestFunctionsItemParams
from .agent_v1history import AgentV1HistoryParams
Expand Down Expand Up @@ -92,6 +94,8 @@
"AgentV1ConversationTextParams": ".agent_v1conversation_text",
"AgentV1ErrorParams": ".agent_v1error",
"AgentV1ForceEndTurnParams": ".agent_v1force_end_turn",
"AgentV1FunctionCallCancelledFunctionsItemParams": ".agent_v1function_call_cancelled_functions_item",
"AgentV1FunctionCallCancelledParams": ".agent_v1function_call_cancelled",
"AgentV1FunctionCallRequestFunctionsItemParams": ".agent_v1function_call_request_functions_item",
"AgentV1FunctionCallRequestParams": ".agent_v1function_call_request",
"AgentV1HistoryParams": ".agent_v1history",
Expand Down Expand Up @@ -188,6 +192,8 @@ def __dir__():
"AgentV1ConversationTextParams",
"AgentV1ErrorParams",
"AgentV1ForceEndTurnParams",
"AgentV1FunctionCallCancelledFunctionsItemParams",
"AgentV1FunctionCallCancelledParams",
"AgentV1FunctionCallRequestFunctionsItemParams",
"AgentV1FunctionCallRequestParams",
"AgentV1HistoryParams",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import typing_extensions
from .agent_v1function_call_cancelled_functions_item import AgentV1FunctionCallCancelledFunctionsItemParams


class AgentV1FunctionCallCancelledParams(typing_extensions.TypedDict):
type: typing.Literal["FunctionCallCancelled"]
"""
Message type identifier for cancelled function calls
"""

functions: typing.Sequence[AgentV1FunctionCallCancelledFunctionsItemParams]
"""
The function calls that are no longer valid
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was auto-generated by Fern from our API Definition.

import typing_extensions


class AgentV1FunctionCallCancelledFunctionsItemParams(typing_extensions.TypedDict):
id: str
"""
The id from the FunctionCallRequest that is now cancelled. Send no FunctionCallResponse for this id
"""

name: str
"""
The name of the cancelled function
"""
7 changes: 3 additions & 4 deletions src/deepgram/agent/v1/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .types.agent_v1conversation_text import AgentV1ConversationText
from .types.agent_v1error import AgentV1Error
from .types.agent_v1force_end_turn import AgentV1ForceEndTurn
from .types.agent_v1function_call_cancelled import AgentV1FunctionCallCancelled
from .types.agent_v1function_call_request import AgentV1FunctionCallRequest
from .types.agent_v1history import AgentV1History
from .types.agent_v1inject_agent_message import AgentV1InjectAgentMessage
Expand Down Expand Up @@ -43,10 +44,7 @@


def _sanitize_numeric_types(obj: typing.Any) -> typing.Any:
"""Convert whole-number floats to integers for wire-compatible JSON.

See: internal-api-specs/issues/205
"""
"""Convert whole-number floats to integers for wire-compatible JSON. See: internal-api-specs/issues/205."""
if isinstance(obj, dict):
return {key: _sanitize_numeric_types(value) for key, value in obj.items()}
if isinstance(obj, list):
Expand All @@ -71,6 +69,7 @@ def _sanitize_numeric_types(obj: typing.Any) -> typing.Any:
AgentV1AgentThinking,
AgentV1LatencyReport,
AgentV1FunctionCallRequest,
AgentV1FunctionCallCancelled,
AgentV1AgentStartedSpeaking,
AgentV1AgentAudioDone,
AgentV1Error,
Expand Down
6 changes: 6 additions & 0 deletions src/deepgram/agent/v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from .agent_v1conversation_text_role import AgentV1ConversationTextRole
from .agent_v1error import AgentV1Error
from .agent_v1force_end_turn import AgentV1ForceEndTurn
from .agent_v1function_call_cancelled import AgentV1FunctionCallCancelled
from .agent_v1function_call_cancelled_functions_item import AgentV1FunctionCallCancelledFunctionsItem
from .agent_v1function_call_request import AgentV1FunctionCallRequest
from .agent_v1function_call_request_functions_item import AgentV1FunctionCallRequestFunctionsItem
from .agent_v1history import AgentV1History
Expand Down Expand Up @@ -100,6 +102,8 @@
"AgentV1ConversationTextRole": ".agent_v1conversation_text_role",
"AgentV1Error": ".agent_v1error",
"AgentV1ForceEndTurn": ".agent_v1force_end_turn",
"AgentV1FunctionCallCancelled": ".agent_v1function_call_cancelled",
"AgentV1FunctionCallCancelledFunctionsItem": ".agent_v1function_call_cancelled_functions_item",
"AgentV1FunctionCallRequest": ".agent_v1function_call_request",
"AgentV1FunctionCallRequestFunctionsItem": ".agent_v1function_call_request_functions_item",
"AgentV1History": ".agent_v1history",
Expand Down Expand Up @@ -205,6 +209,8 @@ def __dir__():
"AgentV1ConversationTextRole",
"AgentV1Error",
"AgentV1ForceEndTurn",
"AgentV1FunctionCallCancelled",
"AgentV1FunctionCallCancelledFunctionsItem",
"AgentV1FunctionCallRequest",
"AgentV1FunctionCallRequestFunctionsItem",
"AgentV1History",
Expand Down
29 changes: 29 additions & 0 deletions src/deepgram/agent/v1/types/agent_v1function_call_cancelled.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ....core.pydantic_utilities import IS_PYDANTIC_V2
from ....core.unchecked_base_model import UncheckedBaseModel
from .agent_v1function_call_cancelled_functions_item import AgentV1FunctionCallCancelledFunctionsItem


class AgentV1FunctionCallCancelled(UncheckedBaseModel):
type: typing.Literal["FunctionCallCancelled"] = pydantic.Field(default="FunctionCallCancelled")
"""
Message type identifier for cancelled function calls
"""

functions: typing.List[AgentV1FunctionCallCancelledFunctionsItem] = pydantic.Field()
"""
The function calls that are no longer valid
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ....core.pydantic_utilities import IS_PYDANTIC_V2
from ....core.unchecked_base_model import UncheckedBaseModel


class AgentV1FunctionCallCancelledFunctionsItem(UncheckedBaseModel):
id: str = pydantic.Field()
"""
The id from the FunctionCallRequest that is now cancelled. Send no FunctionCallResponse for this id
"""

name: str = pydantic.Field()
"""
The name of the cancelled function
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
2 changes: 1 addition & 1 deletion src/deepgram/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_headers(self) -> typing.Dict[str, str]:
try:
_sdk_version = _fern_importlib_metadata.version("deepgram-sdk")
except _fern_importlib_metadata.PackageNotFoundError:
_sdk_version = "7.8.1"
_sdk_version = "7.9.1"

headers: typing.Dict[str, str] = {
"User-Agent": "deepgram-sdk/" + _sdk_version,
Expand Down
8 changes: 4 additions & 4 deletions src/deepgram/listen/v2/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ async def send_force_end_turn(self, message: typing.Optional[ListenV2ForceEndTur
"""
Send a message to the websocket connection.
The message will be sent as a ListenV2ForceEndTurn.
Requires server-side enablement. On deployments without the feature, the
server returns UNPARSABLE_CLIENT_MESSAGE and closes the connection.
This requires server-side enablement. On deployments without the feature, the server returns
UNPARSABLE_CLIENT_MESSAGE and closes the connection.
"""
await self._send_model(message or ListenV2ForceEndTurn(type="ForceEndTurn"))

Expand Down Expand Up @@ -203,8 +203,8 @@ def send_force_end_turn(self, message: typing.Optional[ListenV2ForceEndTurn] = N
"""
Send a message to the websocket connection.
The message will be sent as a ListenV2ForceEndTurn.
Requires server-side enablement. On deployments without the feature, the
server returns UNPARSABLE_CLIENT_MESSAGE and closes the connection.
This requires server-side enablement. On deployments without the feature, the server returns
UNPARSABLE_CLIENT_MESSAGE and closes the connection.
"""
self._send_model(message or ListenV2ForceEndTurn(type="ForceEndTurn"))

Expand Down
5 changes: 5 additions & 0 deletions src/deepgram/requests/think_settings_v1functions_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class ThinkSettingsV1FunctionsItemParams(typing_extensions.TypedDict):
Function parameters
"""

defer_until_eot: typing_extensions.NotRequired[bool]
"""
Hold this function call until the user's turn is confirmed instead of dispatching it speculatively. Set it to true for actions that cannot be undone. If the turn resumes, a deferred call is discarded before it runs. Defaults to false
"""

endpoint: typing_extensions.NotRequired[ThinkSettingsV1FunctionsItemEndpointParams]
"""
The Function endpoint to call. if not passed, function is called client-side
Expand Down
5 changes: 5 additions & 0 deletions src/deepgram/types/think_settings_v1functions_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class ThinkSettingsV1FunctionsItem(UncheckedBaseModel):
Function parameters
"""

defer_until_eot: typing.Optional[bool] = pydantic.Field(default=None)
"""
Hold this function call until the user's turn is confirmed instead of dispatching it speculatively. Set it to true for actions that cannot be undone. If the turn resumes, a deferred call is discarded before it runs. Defaults to false
"""

endpoint: typing.Optional[ThinkSettingsV1FunctionsItemEndpoint] = pydantic.Field(default=None)
"""
The Function endpoint to call. if not passed, function is called client-side
Expand Down
Loading
Loading