Skip to main content

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.53.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

vocode-0.1.53-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file vocode-0.1.53.tar.gz.

File metadata

  • Download URL: vocode-0.1.53.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

Hashes for vocode-0.1.53.tar.gz
Algorithm Hash digest
SHA256 305a5d32a16c13b829a71b6969d823c52f54cae021328e83eb740b5c1bd02ceb
MD5 dd11fbb08b2885f605ae4b7a8e71d0d8
BLAKE2b-256 2a2715071876dfd21c09a0428a4989242ded4aa4f784329ff3578619bf80fa9c

See more details on using hashes here.

File details

Details for the file vocode-0.1.53-py3-none-any.whl.

File metadata

  • Download URL: vocode-0.1.53-py3-none-any.whl
  • Upload date:
  • Size: 27.0 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

Hashes for vocode-0.1.53-py3-none-any.whl
Algorithm Hash digest
SHA256 a8af9eb1838efea6035696875440c17db7de6961714cda5ebf40e8c742dc022a
MD5 613856f3e327f4eaf87e8d1bc39fbfa9
BLAKE2b-256 c33b62b947f4af05d3fd60cd640d0df17adbe388cb6dc5e7c3d19003984ed783

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page