The all-in-one voice SDK
Project description
vocode Python SDK
pip install vocode
import asyncio
import signal
import vocode
vocode.api_key = "YOUR_API_KEY"
from vocode.conversation import Conversation
from vocode.helpers import create_microphone_input_and_speaker_output
from vocode.models.transcriber import DeepgramTranscriberConfig
from vocode.models.agent import ChatGPTAgentConfig
from vocode.models.synthesizer import AzureSynthesizerConfig
if __name__ == "__main__":
microphone_input, speaker_output = create_microphone_input_and_speaker_output(
use_default_devices=True
)
conversation = Conversation(
input_device=microphone_input,
output_device=speaker_output,
transcriber_config=DeepgramTranscriberConfig.from_input_device(microphone_input),
agent_config=ChatGPTAgentConfig(
initial_message=BaseMessage(text="Hello!"),
prompt_preamble="The AI is having a pleasant conversation about life."
),
synthesizer_config=AzureSynthesizerConfig.from_output_device(speaker_output)
)
# This allows you to stop the conversation with a KeyboardInterrupt
signal.signal(signal.SIGINT, lambda _0, _1: conversation.deactivate())
asyncio.run(conversation.start())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vocode-0.1.56.tar.gz
(4.6 MB
view details)
Built Distribution
File details
Details for the file vocode-0.1.56.tar.gz
.
File metadata
- Download URL: vocode-0.1.56.tar.gz
- Upload date:
- Size: 4.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.9 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 422c55ed9e81acaa46fc26bea0aeb1f6229d11e81c182e7ce39819a1b1f2b579 |
|
MD5 | 805ed1504073a332a4800c5d54d5476f |
|
BLAKE2b-256 | bcde36046b18024c740a884b0025e14059f5abb2a8ef9dc89bc9de0fcf78a1dd |
File details
Details for the file vocode-0.1.56-py3-none-any.whl
.
File metadata
- Download URL: vocode-0.1.56-py3-none-any.whl
- Upload date:
- Size: 4.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.9 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af074396a290f5628574e591bc6ba0d748ae115d7004cfbff04b6d40c959270a |
|
MD5 | fcb1290942940bf58897615157c19570 |
|
BLAKE2b-256 | 2c970c309e4c6bf996db9bcc4818ca5fd145ee4fd8590131ee08ce975e6b0e23 |