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.54.tar.gz
(15.3 kB
view details)
Built Distribution
vocode-0.1.54-py3-none-any.whl
(27.1 kB
view details)
File details
Details for the file vocode-0.1.54.tar.gz
.
File metadata
- Download URL: vocode-0.1.54.tar.gz
- Upload date:
- Size: 15.3 kB
- 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 | 2d9c45e3bda0cab47cafa84c8bd485e42045c82757b0b6171e9c908ede0be628 |
|
MD5 | 582458a41061aa2bd3480edb2c1ac050 |
|
BLAKE2b-256 | b030137420cc7604fe4711199e69f8c7f2202d3890d52602f4f6f891b2b253ef |
File details
Details for the file vocode-0.1.54-py3-none-any.whl
.
File metadata
- Download URL: vocode-0.1.54-py3-none-any.whl
- Upload date:
- Size: 27.1 kB
- 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 | 5378d30247804aff177daeceb7f3de8536cb5b912ecd87a40f2dc673e63de0fa |
|
MD5 | c0bbdefd68e5ab6c1d8dfd0e42aad671 |
|
BLAKE2b-256 | 1500b177a0ad299e1f0bb0a896ce51298b322afbe29da12c3d16190e868454b6 |