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.57.tar.gz
(4.6 MB
view details)
Built Distribution
File details
Details for the file vocode-0.1.57.tar.gz
.
File metadata
- Download URL: vocode-0.1.57.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 | a403f54180aafdca38375311a8eeacddb478b7746ec1f036e963625124040cae |
|
MD5 | d5185160d5b437402c82edd1ef92a500 |
|
BLAKE2b-256 | a123ca09f60364423f6556e3fccf42c0f12f24109475231c6857d67098eef02e |
File details
Details for the file vocode-0.1.57-py3-none-any.whl
.
File metadata
- Download URL: vocode-0.1.57-py3-none-any.whl
- Upload date:
- Size: 4.7 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 | b1e3499dfd9418cc77fb5f7eb55c5a15a47e374cf3a18a49f11488ec8b2d2a05 |
|
MD5 | 41215f0181d8d986bf0abf33636d0450 |
|
BLAKE2b-256 | cda604d288d4e1683b1d90e8bf9f747aafbb1b58829d43bcdb84f2b8b8a58686 |