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
15 changes: 15 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,18 @@ Here are a few types of contributions that we would be interested in hearing abo
## Making Code Contributions

for those interested in contributing code to the project, please review the [Code Contribution Guide](https://github.com/deepgram/deepgram-python-sdk/blob/main/.github/CODE_CONTRIBUTIONS_GUIDE.md) for more details.

## Building Locally

Assuming you are using `pipenv`:

```bash
# Install deps
pipenv install
# Build package
pipenv run python3 -m build
# Install package from local build
pipenv install ./dist/deepgram_sdk-0.0.0.tar.gz
# Try an example!
DEEPGRAM_API_KEY=<key> pipenv run python3 examples/agent/async_simple/main.py
```
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ dist/
build/
poetry.lock

# examples
chatlog.txt
output_*.wav
11 changes: 6 additions & 5 deletions deepgram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@
ConversationTextResponse,
UserStartedSpeakingResponse,
AgentThinkingResponse,
FunctionCalling,
FunctionCallRequest,
AgentStartedSpeakingResponse,
AgentAudioDoneResponse,
Expand All @@ -333,27 +332,29 @@

from .client import (
# top level
SettingsConfigurationOptions,
UpdateInstructionsOptions,
SettingsOptions,
UpdatePromptOptions,
UpdateSpeakOptions,
InjectAgentMessageOptions,
FunctionCallResponse,
AgentKeepAlive,
# sub level
Listen,
ListenProvider,
Speak,
SpeakProvider,
Header,
Item,
Properties,
Parameters,
Function,
Provider,
Think,
ThinkProvider,
Agent,
Input,
Output,
Audio,
Context,
Endpoint,
)

# utilities
Expand Down
11 changes: 6 additions & 5 deletions deepgram/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@
ConversationTextResponse,
UserStartedSpeakingResponse,
AgentThinkingResponse,
FunctionCalling,
FunctionCallRequest,
AgentStartedSpeakingResponse,
AgentAudioDoneResponse,
Expand All @@ -347,27 +346,29 @@

from .clients import (
# top level
SettingsConfigurationOptions,
UpdateInstructionsOptions,
SettingsOptions,
UpdatePromptOptions,
UpdateSpeakOptions,
InjectAgentMessageOptions,
FunctionCallResponse,
AgentKeepAlive,
# sub level
Listen,
ListenProvider,
Speak,
SpeakProvider,
Header,
Item,
Properties,
Parameters,
Function,
Provider,
Think,
ThinkProvider,
Agent,
Input,
Output,
Audio,
Context,
Endpoint,
)


Expand Down
11 changes: 6 additions & 5 deletions deepgram/clients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@
ConversationTextResponse,
UserStartedSpeakingResponse,
AgentThinkingResponse,
FunctionCalling,
FunctionCallRequest,
AgentStartedSpeakingResponse,
AgentAudioDoneResponse,
Expand All @@ -356,25 +355,27 @@

from .agent import (
# top level
SettingsConfigurationOptions,
UpdateInstructionsOptions,
SettingsOptions,
UpdatePromptOptions,
UpdateSpeakOptions,
InjectAgentMessageOptions,
FunctionCallResponse,
AgentKeepAlive,
# sub level
Listen,
ListenProvider,
Speak,
SpeakProvider,
Header,
Item,
Properties,
Parameters,
Function,
Provider,
Think,
ThinkProvider,
Agent,
Input,
Output,
Audio,
Context,
Endpoint,
)
11 changes: 6 additions & 5 deletions deepgram/clients/agent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
ConversationTextResponse,
UserStartedSpeakingResponse,
AgentThinkingResponse,
FunctionCalling,
FunctionCallRequest,
AgentStartedSpeakingResponse,
AgentAudioDoneResponse,
Expand All @@ -31,25 +30,27 @@

from .client import (
# top level
SettingsConfigurationOptions,
UpdateInstructionsOptions,
SettingsOptions,
UpdatePromptOptions,
UpdateSpeakOptions,
InjectAgentMessageOptions,
FunctionCallResponse,
AgentKeepAlive,
# sub level
Listen,
ListenProvider,
Speak,
SpeakProvider,
Header,
Item,
Properties,
Parameters,
Function,
Provider,
Think,
ThinkProvider,
Agent,
Input,
Output,
Audio,
Context,
Endpoint,
)
22 changes: 12 additions & 10 deletions deepgram/clients/agent/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
ConversationTextResponse as LatestConversationTextResponse,
UserStartedSpeakingResponse as LatestUserStartedSpeakingResponse,
AgentThinkingResponse as LatestAgentThinkingResponse,
FunctionCalling as LatestFunctionCalling,
FunctionCallRequest as LatestFunctionCallRequest,
AgentStartedSpeakingResponse as LatestAgentStartedSpeakingResponse,
AgentAudioDoneResponse as LatestAgentAudioDoneResponse,
Expand All @@ -30,27 +29,29 @@

from .v1 import (
# top level
SettingsConfigurationOptions as LatestSettingsConfigurationOptions,
UpdateInstructionsOptions as LatestUpdateInstructionsOptions,
SettingsOptions as LatestSettingsOptions,
UpdatePromptOptions as LatestUpdatePromptOptions,
UpdateSpeakOptions as LatestUpdateSpeakOptions,
InjectAgentMessageOptions as LatestInjectAgentMessageOptions,
FunctionCallResponse as LatestFunctionCallResponse,
AgentKeepAlive as LatestAgentKeepAlive,
# sub level
Listen as LatestListen,
ListenProvider as LatestListenProvider,
Speak as LatestSpeak,
SpeakProvider as LatestSpeakProvider,
Header as LatestHeader,
Item as LatestItem,
Properties as LatestProperties,
Parameters as LatestParameters,
Function as LatestFunction,
Provider as LatestProvider,
Think as LatestThink,
ThinkProvider as LatestThinkProvider,
Agent as LatestAgent,
Input as LatestInput,
Output as LatestOutput,
Audio as LatestAudio,
Context as LatestContext,
Endpoint as LatestEndpoint,
)


Expand All @@ -70,31 +71,32 @@
ConversationTextResponse = LatestConversationTextResponse
UserStartedSpeakingResponse = LatestUserStartedSpeakingResponse
AgentThinkingResponse = LatestAgentThinkingResponse
FunctionCalling = LatestFunctionCalling
FunctionCallRequest = LatestFunctionCallRequest
AgentStartedSpeakingResponse = LatestAgentStartedSpeakingResponse
AgentAudioDoneResponse = LatestAgentAudioDoneResponse
InjectionRefusedResponse = LatestInjectionRefusedResponse


SettingsConfigurationOptions = LatestSettingsConfigurationOptions
UpdateInstructionsOptions = LatestUpdateInstructionsOptions
SettingsOptions = LatestSettingsOptions
UpdatePromptOptions = LatestUpdatePromptOptions
UpdateSpeakOptions = LatestUpdateSpeakOptions
InjectAgentMessageOptions = LatestInjectAgentMessageOptions
FunctionCallResponse = LatestFunctionCallResponse
AgentKeepAlive = LatestAgentKeepAlive

Listen = LatestListen
ListenProvider = LatestListenProvider
Speak = LatestSpeak
SpeakProvider = LatestSpeakProvider
Header = LatestHeader
Item = LatestItem
Properties = LatestProperties
Parameters = LatestParameters
Function = LatestFunction
Provider = LatestProvider
Think = LatestThink
ThinkProvider = LatestThinkProvider
Agent = LatestAgent
Input = LatestInput
Output = LatestOutput
Audio = LatestAudio
Context = LatestContext
Endpoint = LatestEndpoint
5 changes: 2 additions & 3 deletions deepgram/clients/agent/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ class AgentWebSocketEvents(StrEnum):
ConversationText: str = "ConversationText"
UserStartedSpeaking: str = "UserStartedSpeaking"
AgentThinking: str = "AgentThinking"
FunctionCalling: str = "FunctionCalling"
FunctionCallRequest: str = "FunctionCallRequest"
AgentStartedSpeaking: str = "AgentStartedSpeaking"
AgentAudioDone: str = "AgentAudioDone"
Error: str = "Error"
Unhandled: str = "Unhandled"

# client
SettingsConfiguration: str = "SettingsConfiguration"
UpdateInstructions: str = "UpdateInstructions"
Settings: str = "Settings"
UpdatePrompt: str = "UpdatePrompt"
UpdateSpeak: str = "UpdateSpeak"
InjectAgentMessage: str = "InjectAgentMessage"
InjectionRefused: str = "InjectionRefused"
Expand Down
11 changes: 6 additions & 5 deletions deepgram/clients/agent/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
ConversationTextResponse,
UserStartedSpeakingResponse,
AgentThinkingResponse,
FunctionCalling,
FunctionCallRequest,
AgentStartedSpeakingResponse,
AgentAudioDoneResponse,
Expand All @@ -35,25 +34,27 @@

from .websocket import (
# top level
SettingsConfigurationOptions,
UpdateInstructionsOptions,
SettingsOptions,
UpdatePromptOptions,
UpdateSpeakOptions,
InjectAgentMessageOptions,
FunctionCallResponse,
AgentKeepAlive,
# sub level
Listen,
ListenProvider,
Speak,
SpeakProvider,
Header,
Item,
Properties,
Parameters,
Function,
Provider,
Think,
ThinkProvider,
Agent,
Input,
Output,
Audio,
Context,
Endpoint,
)
11 changes: 6 additions & 5 deletions deepgram/clients/agent/v1/websocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,34 @@
ConversationTextResponse,
UserStartedSpeakingResponse,
AgentThinkingResponse,
FunctionCalling,
FunctionCallRequest,
AgentStartedSpeakingResponse,
AgentAudioDoneResponse,
InjectionRefusedResponse,
)
from .options import (
# top level
SettingsConfigurationOptions,
UpdateInstructionsOptions,
SettingsOptions,
UpdatePromptOptions,
UpdateSpeakOptions,
InjectAgentMessageOptions,
FunctionCallResponse,
AgentKeepAlive,
# sub level
Listen,
ListenProvider,
Speak,
SpeakProvider,
Header,
Item,
Properties,
Parameters,
Function,
Provider,
Think,
ThinkProvider,
Agent,
Input,
Output,
Audio,
Context,
Endpoint,
)
Loading