From 5f9352a97c77c65b538fb08b57c432f4ac6308d4 Mon Sep 17 00:00:00 2001 From: Ajay Raj Date: Tue, 28 Mar 2023 11:55:08 -0700 Subject: [PATCH 1/6] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 27cbb5c..858e3bd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ -# vocode Python SDK +
+ +![Hero](https://user-images.githubusercontent.com/6234599/228337850-e32bb01d-3701-47ef-a433-3221c9e0e56e.png) + + +[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/vocodehq.svg?style=social&label=Follow%20%40vocodehq)](https://twitter.com/vocodehq) [![GitHub Repo stars](https://img.shields.io/github/stars/vocodedev/vocode-python?style=social)](https://github.com/vocodedev/vocode-python) + +[Community](https://discord.gg/NaU4mMgcnC) | [Docs](https://docs.vocode.dev) | [Dashboard](https://app.vocode.dev) +
``` pip install vocode From c1378b6553c6c887b6a999e1ae5671b20db4b75b Mon Sep 17 00:00:00 2001 From: Ajay Raj Date: Tue, 28 Mar 2023 13:33:31 -0700 Subject: [PATCH 2/6] Update README.md --- README.md | 143 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 126 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 858e3bd..a148423 100644 --- a/README.md +++ b/README.md @@ -8,39 +8,148 @@ [Community](https://discord.gg/NaU4mMgcnC) | [Docs](https://docs.vocode.dev) | [Dashboard](https://app.vocode.dev) -``` -pip install vocode +# vocode + +### **Build voice-based LLM apps in minutes** + +Vocode is an open source library that makes it easy to build voice-based LLM apps. Using Vocode, you can build real-time streaming conversations with LLMs and deploy them to phone calls, Zoom meetings, and more. You can also build personal assistants or apps like voice-based chess. Vocode provides easy abstractions and integrations so that everything you need is in a single library. + +# **⭐️ Features** +- 🗣 Spin up a conversation with your system audio in minutes +- ➡️ 📞 Set up a phone number that responds with a LLM-based agent +- 📞 ➡️ Send out phone calls from your phone number managed by an LLM-based agent +- Out of the box integrations with: + - Transcription services, including: + - [Deepgram](https://deepgram.com/) + - [AssemblyAI](https://www.assemblyai.com/) + - [Google Cloud](https://cloud.google.com/speech-to-text) + - [Whisper](https://openai.com/blog/introducing-chatgpt-and-whisper-apis) + - LLMs, including: + - [ChatGPT](https://openai.com/blog/chatgpt) + - [GPT-4](https://platform.openai.com/docs/models/gpt-4) + - Synthesis services, including: + - [Microsoft Azure](https://azure.microsoft.com/en-us/products/cognitive-services/text-to-speech/) + - [Google Cloud](https://cloud.google.com/text-to-speech) + - [Eleven Labs](https://elevenlabs.io/) + +Check out our React SDK [here](https://github.com/vocodedev/vocode-react-sdk)! + +# **☁️ Quickstart (Hosted)** + +First, get a *free* API key from our [dashboard](https://app.vocode.dev). + +```bash +pip install 'vocode[io]' ``` ```python import asyncio import signal + import vocode - -vocode.api_key = "YOUR_API_KEY" - -from vocode.conversation import Conversation +from vocode.streaming.hosted_streaming_conversation import HostedStreamingConversation +from vocode.streaming.streaming_conversation import StreamingConversation 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 +from vocode.streaming.models.transcriber import ( + DeepgramTranscriberConfig, + PunctuationEndpointingConfig, +) +from vocode.streaming.models.agent import ChatGPTAgentConfig +from vocode.streaming.models.message import BaseMessage +from vocode.streaming.models.synthesizer import AzureSynthesizerConfig + +vocode.api_key = "" + if __name__ == "__main__": microphone_input, speaker_output = create_microphone_input_and_speaker_output( - use_default_devices=True + streaming=True, use_default_devices=False ) - conversation = Conversation( + conversation = HostedStreamingConversation( 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." + transcriber_config=DeepgramTranscriberConfig.from_input_device( + microphone_input, + endpointing_config=PunctuationEndpointingConfig(), ), - synthesizer_config=AzureSynthesizerConfig.from_output_device(speaker_output) + agent_config=ChatGPTAgentConfig( + initial_message=BaseMessage(text="Hello!"), + prompt_preamble="Have 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()) ``` + +# **🚀 Quickstart (Self-hosted)** + +```bash +pip install 'vocode[io]' +``` + +```python +import asyncio +import signal + +import vocode +from vocode.streaming.streaming_conversation import StreamingConversation +from vocode.helpers import create_microphone_input_and_speaker_output +from vocode.streaming.models.transcriber import ( + DeepgramTranscriberConfig, + PunctuationEndpointingConfig, +) +from vocode.streaming.models.agent import ChatGPTAgentConfig +from vocode.streaming.models.message import BaseMessage +from vocode.streaming.models.synthesizer import AzureSynthesizerConfig + +# these can also be set as environment variables +vocode.setenv( + OPENAI_API_KEY="", + DEEPGRAM_API_KEY="", + AZURE_SPEECH_KEY="", + AZURE_SPEECH_REGION="", +) + + +async def main(): + microphone_input, speaker_output = create_microphone_input_and_speaker_output( + streaming=True, use_default_devices=False + ) + + conversation = StreamingConversation( + output_device=speaker_output, + transcriber_config=DeepgramTranscriberConfig.from_input_device( + microphone_input, endpointing_config=PunctuationEndpointingConfig() + ), + agent_config=ChatGPTAgentConfig( + initial_message=BaseMessage(text="Hello!"), + prompt_preamble="Have a pleasant conversation about life", + ), + synthesizer_config=AzureSynthesizerConfig.from_output_device(speaker_output), + ) + await conversation.start() + print("Conversation started, press Ctrl+C to end") + signal.signal(signal.SIGINT, lambda _0, _1: conversation.terminate()) + while conversation.is_active(): + chunk = microphone_input.get_audio() + if chunk: + conversation.receive_audio(chunk) + await asyncio.sleep(0) + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +# **📞 Phone call quickstarts **# +- [Inbound calls - Hosted](https://docs.vocode.dev/telephony#inbound-calls) +- [Outbound calls - Hosted](https://docs.vocode.dev/telephony#outbound-calls) +- [Telephony Server - self-hosted](https://github.com/vocodedev/vocode-python/blob/main/examples/telephony_app.py) + + + +# **🌱 Documentation** + +[docs.vocode.dev](https://docs.vocode.dev/) From 29258eca01c7cfca80591103418c46551573c2bf Mon Sep 17 00:00:00 2001 From: Ajay Raj Date: Tue, 28 Mar 2023 13:35:24 -0700 Subject: [PATCH 3/6] Update README.md --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a148423..454c5f4 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Vocode is an open source library that makes it easy to build voice-based LLM apps. Using Vocode, you can build real-time streaming conversations with LLMs and deploy them to phone calls, Zoom meetings, and more. You can also build personal assistants or apps like voice-based chess. Vocode provides easy abstractions and integrations so that everything you need is in a single library. -# **⭐️ Features** +# ⭐️ Features - 🗣 Spin up a conversation with your system audio in minutes - ➡️ 📞 Set up a phone number that responds with a LLM-based agent - 📞 ➡️ Send out phone calls from your phone number managed by an LLM-based agent @@ -34,7 +34,7 @@ Vocode is an open source library that makes it easy to build voice-based LLM app Check out our React SDK [here](https://github.com/vocodedev/vocode-react-sdk)! -# **☁️ Quickstart (Hosted)** +# ☁️ Quickstart (Hosted) First, get a *free* API key from our [dashboard](https://app.vocode.dev). @@ -83,7 +83,7 @@ if __name__ == "__main__": asyncio.run(conversation.start()) ``` -# **🚀 Quickstart (Self-hosted)** +# 🚀 Quickstart (Self-hosted) ```bash pip install 'vocode[io]' @@ -143,13 +143,14 @@ if __name__ == "__main__": asyncio.run(main()) ``` -# **📞 Phone call quickstarts **# +# 📞 Phone call quickstarts + - [Inbound calls - Hosted](https://docs.vocode.dev/telephony#inbound-calls) - [Outbound calls - Hosted](https://docs.vocode.dev/telephony#outbound-calls) -- [Telephony Server - self-hosted](https://github.com/vocodedev/vocode-python/blob/main/examples/telephony_app.py) +- [Telephony Server - Self-hosted](https://github.com/vocodedev/vocode-python/blob/main/examples/telephony_app.py) -# **🌱 Documentation** +# 🌱 Documentation [docs.vocode.dev](https://docs.vocode.dev/) From fe133b584305609f12eb0d0a4eda907bdf7a7510 Mon Sep 17 00:00:00 2001 From: Ajay Raj Date: Tue, 28 Mar 2023 13:39:56 -0700 Subject: [PATCH 4/6] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 454c5f4..706291c 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Vocode is an open source library that makes it easy to build voice-based LLM app - LLMs, including: - [ChatGPT](https://openai.com/blog/chatgpt) - [GPT-4](https://platform.openai.com/docs/models/gpt-4) + - [Anthropic](https://www.anthropic.com/) - coming soon! - Synthesis services, including: - [Microsoft Azure](https://azure.microsoft.com/en-us/products/cognitive-services/text-to-speech/) - [Google Cloud](https://cloud.google.com/text-to-speech) From f8299caaf6cf3e32be049e0d8908ad7a80361213 Mon Sep 17 00:00:00 2001 From: Ajay Raj Date: Tue, 28 Mar 2023 13:45:13 -0700 Subject: [PATCH 5/6] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 706291c..c395751 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,10 @@ Vocode is an open source library that makes it easy to build voice-based LLM apps. Using Vocode, you can build real-time streaming conversations with LLMs and deploy them to phone calls, Zoom meetings, and more. You can also build personal assistants or apps like voice-based chess. Vocode provides easy abstractions and integrations so that everything you need is in a single library. # ⭐️ Features -- 🗣 Spin up a conversation with your system audio in minutes -- ➡️ 📞 Set up a phone number that responds with a LLM-based agent -- 📞 ➡️ Send out phone calls from your phone number managed by an LLM-based agent +- 🗣 [Spin up a conversation with your system audio](https://docs.vocode.dev/python-quickstart) +- ➡️ 📞 [Set up a phone number that responds with a LLM-based agent](https://docs.vocode.dev/telephony#inbound-calls) +- 📞 ➡️ [Send out phone calls from your phone number managed by an LLM-based agent](https://docs.vocode.dev/telephony#outbound-calls) +- 🧑‍💻 [Dial into a Zoom call](https://github.com/vocodedev/vocode-python/blob/main/vocode/streaming/telephony/hosted/zoom_dial_in.py) - Out of the box integrations with: - Transcription services, including: - [Deepgram](https://deepgram.com/) From 84989044088dc4f7b0e3ab1fcbc45d518512033e Mon Sep 17 00:00:00 2001 From: Ajay Raj Date: Tue, 28 Mar 2023 13:51:38 -0700 Subject: [PATCH 6/6] Update README.md --- README.md | 98 +++++++++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index c395751..babf01e 100644 --- a/README.md +++ b/README.md @@ -36,55 +36,6 @@ Vocode is an open source library that makes it easy to build voice-based LLM app Check out our React SDK [here](https://github.com/vocodedev/vocode-react-sdk)! -# ☁️ Quickstart (Hosted) - -First, get a *free* API key from our [dashboard](https://app.vocode.dev). - -```bash -pip install 'vocode[io]' -``` - -```python -import asyncio -import signal - -import vocode -from vocode.streaming.hosted_streaming_conversation import HostedStreamingConversation -from vocode.streaming.streaming_conversation import StreamingConversation -from vocode.helpers import create_microphone_input_and_speaker_output -from vocode.streaming.models.transcriber import ( - DeepgramTranscriberConfig, - PunctuationEndpointingConfig, -) -from vocode.streaming.models.agent import ChatGPTAgentConfig -from vocode.streaming.models.message import BaseMessage -from vocode.streaming.models.synthesizer import AzureSynthesizerConfig - -vocode.api_key = "" - - -if __name__ == "__main__": - microphone_input, speaker_output = create_microphone_input_and_speaker_output( - streaming=True, use_default_devices=False - ) - - conversation = HostedStreamingConversation( - input_device=microphone_input, - output_device=speaker_output, - transcriber_config=DeepgramTranscriberConfig.from_input_device( - microphone_input, - endpointing_config=PunctuationEndpointingConfig(), - ), - agent_config=ChatGPTAgentConfig( - initial_message=BaseMessage(text="Hello!"), - prompt_preamble="Have a pleasant conversation about life", - ), - synthesizer_config=AzureSynthesizerConfig.from_output_device(speaker_output), - ) - signal.signal(signal.SIGINT, lambda _0, _1: conversation.deactivate()) - asyncio.run(conversation.start()) -``` - # 🚀 Quickstart (Self-hosted) ```bash @@ -145,6 +96,55 @@ if __name__ == "__main__": asyncio.run(main()) ``` +# ☁️ Quickstart (Hosted) + +First, get a *free* API key from our [dashboard](https://app.vocode.dev). + +```bash +pip install 'vocode[io]' +``` + +```python +import asyncio +import signal + +import vocode +from vocode.streaming.hosted_streaming_conversation import HostedStreamingConversation +from vocode.streaming.streaming_conversation import StreamingConversation +from vocode.helpers import create_microphone_input_and_speaker_output +from vocode.streaming.models.transcriber import ( + DeepgramTranscriberConfig, + PunctuationEndpointingConfig, +) +from vocode.streaming.models.agent import ChatGPTAgentConfig +from vocode.streaming.models.message import BaseMessage +from vocode.streaming.models.synthesizer import AzureSynthesizerConfig + +vocode.api_key = "" + + +if __name__ == "__main__": + microphone_input, speaker_output = create_microphone_input_and_speaker_output( + streaming=True, use_default_devices=False + ) + + conversation = HostedStreamingConversation( + input_device=microphone_input, + output_device=speaker_output, + transcriber_config=DeepgramTranscriberConfig.from_input_device( + microphone_input, + endpointing_config=PunctuationEndpointingConfig(), + ), + agent_config=ChatGPTAgentConfig( + initial_message=BaseMessage(text="Hello!"), + prompt_preamble="Have a pleasant conversation about life", + ), + synthesizer_config=AzureSynthesizerConfig.from_output_device(speaker_output), + ) + signal.signal(signal.SIGINT, lambda _0, _1: conversation.deactivate()) + asyncio.run(conversation.start()) +``` + # 📞 Phone call quickstarts - [Inbound calls - Hosted](https://docs.vocode.dev/telephony#inbound-calls)