You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to the repo and I am trying it out. I have encountered a bug using the following code:
import asyncio
import signal
from pydantic_settings import BaseSettings, SettingsConfigDict
from vocode.helpers import create_streaming_microphone_input_and_speaker_output, \
create_turn_based_microphone_input_and_speaker_output
from vocode.logging import configure_pretty_logging
from vocode.turn_based.agent.chat_gpt_agent import ChatGPTAgent
from vocode.turn_based.synthesizer.eleven_labs_synthesizer import ElevenLabsSynthesizer
from vocode.turn_based.transcriber.whisper_transcriber import WhisperTranscriber
from vocode.turn_based.turn_based_conversation import TurnBasedConversation
configure_pretty_logging()
class Settings(BaseSettings):
"""
Settings for the turn-based conversation quickstart.
These parameters can be configured with environment variables.
"""
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
)
# Define environment variables
deepgram_api_key: str
openai_api_key: str
elevenlabs_api_key: str
settings = Settings()
if __name__ == "__main__":
(
microphone_input,
speaker_output,
) = create_turn_based_microphone_input_and_speaker_output(
use_default_devices=True,
)
conversation = TurnBasedConversation(
input_device=microphone_input,
output_device=speaker_output,
transcriber=WhisperTranscriber(api_key=settings.openai_api_key),
agent=ChatGPTAgent(
api_key=settings.openai_api_key,
system_prompt="The AI is having a pleasant conversation about life",
initial_message="Hello!",
),
synthesizer=ElevenLabsSynthesizer(
api_key=settings.elevenlabs_api_key,
voice_id="Lhvb6ub1gbURNYItrKHe",
stability=0.75,
similarity_boost=0.5
)
)
print("Starting conversation. Press Ctrl+C to exit.")
while True:
try:
input("Press enter to start recording...")
conversation.start_speech()
input("Press enter to end recording...")
conversation.end_speech_and_respond()
except KeyboardInterrupt:
break
The error message is the following:
Traceback (most recent call last):
File "/Users/matteoticli/coding_projects/AIphone/AIphone/test_turn_conversation.py", line 47, in <module>
conversation = TurnBasedConversation(
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/matteoticli/coding_projects/AIphone/venv/lib/python3.11/site-packages/vocode/turn_based/turn_based_conversation.py", line 24, in __init__
self.maybe_play_initial_message()
File "/Users/matteoticli/coding_projects/AIphone/venv/lib/python3.11/site-packages/vocode/turn_based/turn_based_conversation.py", line 28, in maybe_play_initial_message
self.output_device.send_audio(self.synthesizer.synthesize(self.agent.initial_message))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/matteoticli/coding_projects/AIphone/venv/lib/python3.11/site-packages/vocode/turn_based/synthesizer/eleven_labs_synthesizer.py", line 50, in synthesize
return AudioSegment.from_mp3(io.BytesIO(audio)) # type: ignore
^^^^^^^^^^^^^^^^^
TypeError: a bytes-like object is required, not 'generator'
How can I resolve this?
LLM
None
Transcription Services
None
Synthesis Services
None
Telephony Services
None
Conversation Type and Platform
No response
Steps to Reproduce
.
Expected Behavior
.
Screenshots
No response
The text was updated successfully, but these errors were encountered:
Brief Description
I am new to the repo and I am trying it out. I have encountered a bug using the following code:
The error message is the following:
How can I resolve this?
LLM
None
Transcription Services
None
Synthesis Services
None
Telephony Services
None
Conversation Type and Platform
No response
Steps to Reproduce
.
Expected Behavior
.
Screenshots
No response
The text was updated successfully, but these errors were encountered: