Skip to content

Commit 78f7b8f

Browse files
ajar98adnaansMac Wilkinsonsrhinos
authored
[WIP] 0.1.112 docs (vocodedev#556)
* [docs sprint] Updates docs for using transcribers (#9) * [docs sprint] phrase trigger documentation (#16) * [docs sprint] update open source quickstarts (#15) * [docs sprint] Add Documentation on Using Vocode's Loguru Implementation (vocodedev#19) * [docs sprint] Add Documentation on Using Vocode's Loguru Implementation * Remove Tracing --------- Co-authored-by: srhinos <[email protected]> * [docs sprint] Updates docs for using synthesizers (#8) * [docs sprint] using synthesizers docs update * update docs for elevenlabs ws * Apply suggestions from code review Co-authored-by: Adnaan Sachidanandan <[email protected]> --------- Co-authored-by: Adnaan Sachidanandan <[email protected]> * [docs sprint] Updates docs for react quickstart (#10) * [docs sprint] Updates docs for react quickstart * PR feedback * [docs sprint] Adds docs for conversation mechanics and moves endpointing docs from transcribers (#11) * [docs sprint] Updates docs for using transcribers * Adds docs for conversation mechanics and moves endpointing docs from transcribers * Update docs/open-source/conversation-mechanics.md Co-authored-by: Adnaan Sachidanandan <[email protected]> * use mdx * PR feedback --------- Co-authored-by: Adnaan Sachidanandan <[email protected]> * updates docs for events manager (#7) * [docs sprint] python quickstart + working with phone calls (vocodedev#27) * deprecate SpeakerOutput * remove play.ht default voice id * rename open source quickstarts page * remove building block reference * update python quickstart * extra steps to deprecate speakeroutput * finish telephony docs * fix some references + language in how-to-use-it * fix test * [docs sprint] Add Sentry Docs to OS (vocodedev#20) * Add Sentry Docs to OS * Remove Tracing * update docs and fix integration * remove free --------- Co-authored-by: srhinos <[email protected]> Co-authored-by: Ajay Raj <[email protected]> * update README * make mark terminated sync instead of async (vocodedev#28) * [docs sprint] Add Docs on Creating and Using External Actions (vocodedev#18) Also updated example for action agents * rename sentry + move around docs order * update README paths to docs * more updates to README * [docs sprint] update agent and action docs and move legacy docs (vocodedev#29) --------- Co-authored-by: Adnaan Sachidanandan <[email protected]> Co-authored-by: Mac Wilkinson <[email protected]> Co-authored-by: srhinos <[email protected]>
1 parent 53b01da commit 78f7b8f

38 files changed

+1228
-539
lines changed

README.md

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![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)
66
[![Downloads](https://static.pepy.tech/badge/vocode/month)](https://pepy.tech/project/vocode)
77

8-
[Community](https://discord.gg/NaU4mMgcnC) | [Docs](https://docs.vocode.dev) | [Dashboard](https://app.vocode.dev)
8+
[Community](https://discord.gg/NaU4mMgcnC) | [Docs](https://docs.vocode.dev/open-source) | [Dashboard](https://app.vocode.dev)
99

1010
</div>
1111

@@ -19,11 +19,11 @@ We're actively looking for community maintainers, so please reach out if interes
1919

2020
# ⭐️ Features
2121

22-
- 🗣 [Spin up a conversation with your system audio](https://docs.vocode.dev/python-quickstart)
23-
- ➡️ 📞 [Set up a phone number that responds with a LLM-based agent](https://docs.vocode.dev/telephony#inbound-calls)
24-
- 📞 ➡️ [Send out phone calls from your phone number managed by an LLM-based agent](https://docs.vocode.dev/telephony#outbound-calls)
25-
- 🧑‍💻 [Dial into a Zoom call](https://github.com/vocodedev/vocode-python/blob/main/vocode/streaming/telephony/hosted/zoom_dial_in.py)
26-
- 🤖 [Use an outbound call to a real phone number in a Langchain agent](https://docs.vocode.dev/langchain-agent)
22+
- 🗣 [Spin up a conversation with your system audio](https://docs.vocode.dev/open-source/python-quickstart)
23+
- ➡️ 📞 [Set up a phone number that responds with a LLM-based agent](https://docs.vocode.dev/open-source/telephony#inbound-calls)
24+
- 📞 ➡️ [Send out phone calls from your phone number managed by an LLM-based agent](https://docs.vocode.dev/telephony/open-source/#outbound-calls)
25+
- 🧑‍💻 [Dial into a Zoom call](https://github.com/vocodedev/vocode-core/blob/53b01dab0b59f71961ee83dbcaf3653a6935c2e3/vocode/streaming/telephony/conversation/zoom_dial_in.py)
26+
- 🤖 [Use an outbound call to a real phone number in a Langchain agent](https://docs.vocode.dev/open-source/langchain-agent)
2727
- Out of the box integrations with:
2828
- Transcription services, including:
2929
- [AssemblyAI](https://www.assemblyai.com/)
@@ -34,19 +34,16 @@ We're actively looking for community maintainers, so please reach out if interes
3434
- [RevAI](https://www.rev.ai/)
3535
- [Whisper](https://openai.com/blog/introducing-chatgpt-and-whisper-apis)
3636
- [Whisper.cpp](https://github.com/ggerganov/whisper.cpp)
37-
3837
- LLMs, including:
39-
- [ChatGPT](https://openai.com/blog/chatgpt)
40-
- [GPT-4](https://platform.openai.com/docs/models/gpt-4)
38+
- [OpenAI](https://platform.openai.com/docs/models)
4139
- [Anthropic](https://www.anthropic.com/)
42-
- [GPT4All](https://github.com/nomic-ai/gpt4all)
4340
- Synthesis services, including:
4441
- [Rime.ai](https://rime.ai)
4542
- [Microsoft Azure](https://azure.microsoft.com/en-us/products/cognitive-services/text-to-speech/)
4643
- [Google Cloud](https://cloud.google.com/text-to-speech)
4744
- [Play.ht](https://play.ht)
4845
- [Eleven Labs](https://elevenlabs.io/)
49-
- [Coqui](https://coqui.ai/)
46+
- [Cartesia](https://cartesia.ai/)
5047
- [Coqui (OSS)](https://github.com/coqui-ai/TTS)
5148
- [gTTS](https://gtts.readthedocs.io/)
5249
- [StreamElements](https://streamelements.com/)
@@ -59,9 +56,9 @@ Check out our React SDK [here](https://github.com/vocodedev/vocode-react-sdk)!
5956

6057
We're an open source project and are extremely open to contributors adding new features, integrations, and documentation! Please don't hesitate to reach out and get started building with us.
6158

62-
For more information on contributing, see our [Contribution Guide](https://github.com/vocodedev/vocode-python/blob/main/contributing.md).
59+
For more information on contributing, see our [Contribution Guide](https://github.com/vocodedev/vocode-core/blob/main/contributing.md).
6360

64-
And check out our [Roadmap](https://github.com/vocodedev/vocode-python/blob/main/roadmap.md).
61+
And check out our [Roadmap](https://github.com/vocodedev/vocode-core/blob/main/roadmap.md).
6562

6663
We'd love to talk to you on [Discord](https://discord.gg/NaU4mMgcnC) about new ideas and contributing!
6764

@@ -73,31 +70,48 @@ pip install 'vocode'
7370

7471
```python
7572
import asyncio
76-
import logging
7773
import signal
78-
from vocode.streaming.streaming_conversation import StreamingConversation
74+
75+
from pydantic_settings import BaseSettings, SettingsConfigDict
76+
7977
from vocode.helpers import create_streaming_microphone_input_and_speaker_output
80-
from vocode.streaming.transcriber import *
81-
from vocode.streaming.agent import *
82-
from vocode.streaming.synthesizer import *
83-
from vocode.streaming.models.transcriber import *
84-
from vocode.streaming.models.agent import *
85-
from vocode.streaming.models.synthesizer import *
78+
from vocode.logging import configure_pretty_logging
79+
from vocode.streaming.agent.chat_gpt_agent import ChatGPTAgent
80+
from vocode.streaming.models.agent import ChatGPTAgentConfig
8681
from vocode.streaming.models.message import BaseMessage
87-
import vocode
88-
89-
# these can also be set as environment variables
90-
vocode.setenv(
91-
OPENAI_API_KEY="<your OpenAI key>",
92-
DEEPGRAM_API_KEY="<your Deepgram key>",
93-
AZURE_SPEECH_KEY="<your Azure key>",
94-
AZURE_SPEECH_REGION="<your Azure region>",
82+
from vocode.streaming.models.synthesizer import AzureSynthesizerConfig
83+
from vocode.streaming.models.transcriber import (
84+
DeepgramTranscriberConfig,
85+
PunctuationEndpointingConfig,
9586
)
87+
from vocode.streaming.streaming_conversation import StreamingConversation
88+
from vocode.streaming.synthesizer.azure_synthesizer import AzureSynthesizer
89+
from vocode.streaming.transcriber.deepgram_transcriber import DeepgramTranscriber
9690

91+
configure_pretty_logging()
9792

98-
logging.basicConfig()
99-
logger = logging.getLogger(__name__)
100-
logger.setLevel(logging.DEBUG)
93+
94+
class Settings(BaseSettings):
95+
"""
96+
Settings for the streaming conversation quickstart.
97+
These parameters can be configured with environment variables.
98+
"""
99+
100+
openai_api_key: str = "ENTER_YOUR_OPENAI_API_KEY_HERE"
101+
azure_speech_key: str = "ENTER_YOUR_AZURE_KEY_HERE"
102+
deepgram_api_key: str = "ENTER_YOUR_DEEPGRAM_API_KEY_HERE"
103+
104+
azure_speech_region: str = "eastus"
105+
106+
# This means a .env file can be used to overload these settings
107+
# ex: "OPENAI_API_KEY=my_key" will set openai_api_key over the default above
108+
model_config = SettingsConfigDict(
109+
env_file=".env",
110+
env_file_encoding="utf-8",
111+
)
112+
113+
114+
settings = Settings()
101115

102116

103117
async def main():
@@ -106,8 +120,6 @@ async def main():
106120
speaker_output,
107121
) = create_streaming_microphone_input_and_speaker_output(
108122
use_default_devices=False,
109-
logger=logger,
110-
use_blocking_speaker_output=True
111123
)
112124

113125
conversation = StreamingConversation(
@@ -116,24 +128,25 @@ async def main():
116128
DeepgramTranscriberConfig.from_input_device(
117129
microphone_input,
118130
endpointing_config=PunctuationEndpointingConfig(),
119-
)
131+
api_key=settings.deepgram_api_key,
132+
),
120133
),
121134
agent=ChatGPTAgent(
122135
ChatGPTAgentConfig(
136+
openai_api_key=settings.openai_api_key,
123137
initial_message=BaseMessage(text="What up"),
124138
prompt_preamble="""The AI is having a pleasant conversation about life""",
125139
)
126140
),
127141
synthesizer=AzureSynthesizer(
128-
AzureSynthesizerConfig.from_output_device(speaker_output)
142+
AzureSynthesizerConfig.from_output_device(speaker_output),
143+
azure_speech_key=settings.azure_speech_key,
144+
azure_speech_region=settings.azure_speech_region,
129145
),
130-
logger=logger,
131146
)
132147
await conversation.start()
133148
print("Conversation started, press Ctrl+C to end")
134-
signal.signal(
135-
signal.SIGINT, lambda _0, _1: asyncio.create_task(conversation.terminate())
136-
)
149+
signal.signal(signal.SIGINT, lambda _0, _1: asyncio.create_task(conversation.terminate()))
137150
while conversation.is_active():
138151
chunk = await microphone_input.get_audio()
139152
conversation.receive_audio(chunk)
@@ -145,8 +158,8 @@ if __name__ == "__main__":
145158

146159
# 📞 Phone call quickstarts
147160

148-
- [Telephony Server - Self-hosted](https://docs.vocode.dev/telephony)
161+
- [Telephony Server - Self-hosted](https://docs.vocode.dev/open-source/telephony)
149162

150163
# 🌱 Documentation
151164

152-
[docs.vocode.dev](https://docs.vocode.dev/)
165+
[docs.vocode.dev](https://docs.vocode.dev/open-source)

apps/telephony_app/speller_agent.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import typing
21
from typing import Optional, Tuple
32

43
from vocode.streaming.agent.abstract_factory import AbstractAgentFactory
@@ -65,16 +64,10 @@ def create_agent(self, agent_config: AgentConfig) -> BaseAgent:
6564
Exception: If the agent configuration type is not recognized.
6665
"""
6766
# If the agent configuration type is CHAT_GPT, create a ChatGPTAgent.
68-
if agent_config.type == AgentType.CHAT_GPT:
69-
return ChatGPTAgent(
70-
# Cast the agent configuration to ChatGPTAgentConfig as we are sure about the type here.
71-
agent_config=typing.cast(ChatGPTAgentConfig, agent_config)
72-
)
67+
if isinstance(agent_config, ChatGPTAgentConfig):
68+
return ChatGPTAgent(agent_config=agent_config)
7369
# If the agent configuration type is agent_speller, create a SpellerAgent.
74-
elif agent_config.type == "agent_speller":
75-
return SpellerAgent(
76-
# Cast the agent configuration to SpellerAgentConfig as we are sure about the type here.
77-
agent_config=typing.cast(SpellerAgentConfig, agent_config)
78-
)
70+
elif isinstance(agent_config, SpellerAgentConfig):
71+
return SpellerAgent(agent_config=agent_config)
7972
# If the agent configuration type is not recognized, raise an exception.
8073
raise Exception("Invalid agent config")

docs/images/sentry.png

416 KB
Loading

docs/mint.json

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@
4949
"navigation": [
5050
{
5151
"group": "Getting Started",
52-
"pages": ["welcome", "hosted-quickstart", "open-source-quickstart"]
52+
"pages": [
53+
"welcome",
54+
"hosted-quickstart",
55+
"open-source-quickstarts"
56+
]
5357
},
5458
{
5559
"group": "Vocode 101",
@@ -65,26 +69,27 @@
6569
"open-source/python-quickstart",
6670
"open-source/telephony",
6771
"open-source/create-your-own-agent",
68-
"open-source/langchain-agent",
69-
"open-source/action-agents",
70-
"open-source/local-conversation",
72+
"open-source/agent-factory",
73+
"open-source/agents-with-actions",
74+
"open-source/action-phrase-triggers",
75+
"open-source/external-action",
76+
"open-source/conversation-mechanics",
7177
"open-source/events-manager",
7278
"open-source/using-synthesizers",
7379
"open-source/using-transcribers",
7480
"open-source/react-quickstart",
7581
"open-source/playground",
82+
"open-source/sentry",
83+
"open-source/logging-with-loguru",
7684
"open-source/turn-based-conversation",
77-
"open-source/language-support",
78-
"open-source/tracing",
79-
"open-source/agent-factory"
85+
"open-source/language-support"
8086
]
8187
},
8288
{
83-
"group": "Python",
89+
"group": "Legacy (0.0.111) Guides",
8490
"pages": [
85-
"open-source/transcriber-reference",
86-
"open-source/agent-reference",
87-
"open-source/synthesizer-reference"
91+
"open-source/langchain-agent",
92+
"open-source/local-conversation"
8893
]
8994
},
9095
{
@@ -109,7 +114,9 @@
109114
},
110115
{
111116
"group": "Usage",
112-
"pages": ["api-reference/usage/get-usage"]
117+
"pages": [
118+
"api-reference/usage/get-usage"
119+
]
113120
},
114121
{
115122
"group": "Actions",
@@ -223,4 +230,4 @@
223230
"twitter": "https://twitter.com/vocodehq",
224231
"website": "https://www.vocode.dev/"
225232
}
226-
}
233+
}

docs/open-source-quickstart.mdx renamed to docs/open-source-quickstarts.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
2-
title: "Open Source Quickstart"
2+
title: "Open Source Quickstarts"
33
description: "How to get Vocode up and running on your own machine"
44
---
55

66
## Start Developing
77

88
<CardGroup>
9-
<Card title="Python Quick Start" icon="circle-play" href="/open-source/python-quickstart">
9+
<Card
10+
title="Python Quick Start"
11+
icon="circle-play"
12+
href="/open-source/python-quickstart"
13+
>
1014
Quickly get up and running with Vocode by following our Python quick start
1115
guide.
1216
</Card>

docs/open-source/action-agents.mdx

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)