Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Personas config and tts options #125

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Personas config and tts options #125

merged 2 commits into from
Apr 3, 2024

Conversation

williamluer
Copy link
Contributor

@williamluer williamluer commented Apr 3, 2024

User description

  • Store personas in a dict
  • Pass tts and prompt options to agent

Description

  • Implemented a new personas dictionary to manage different voice personas, each with its own TTS configuration and prompt.
  • Updated TTS configuration handling to support different voice parameters for various providers in response_agent.py.
  • Refactored create_room_and_start, connect_daily, and run_connect_daily functions in routers/voice.py to utilize the new personas configuration and tts_config parameter.

Changes walkthrough

Relevant files
Enhancement
response_agent.py
Enhance TTS Configuration for Multiple Providers                             

openduck-py/openduck_py/response_agent.py

  • Enhanced TTS configuration by passing voice_id as voice or voice_name
    parameter based on the provider.
  • +6/-2     
    Configuration changes
    voice.py
    Implement Personas Configuration and TTS Options                             

    openduck-py/openduck_py/routers/voice.py

  • Added a personas dictionary to store configurations for different
    personas.
  • Updated create_room_and_start to use personas config for setting up
    voice and prompt options.
  • Modified connect_daily and run_connect_daily functions to accept
    tts_config instead of voice_id.
  • +36/-10 

    🔍 Anti-patterns Detected:
    openduck-py/openduck_py/routers/voice.py
    IssueLines
    Consider using '{"room_url": room_info['url'], "username": personas[request.prompt]['username'], ... }' instead of a call to 'dict'.151-162
    💡 Usage Guide

    Checking Your Pull Request

    Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

    Talking to CodeAnt AI

    Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

    @codeant-ai ask: Your question here
    

    This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

    Check Your Repository Health

    To analyze the health of your code repository, visit our dashboard at app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

    Copy link

    vercel bot commented Apr 3, 2024

    The latest updates on your projects. Learn more about Vercel for Git ↗︎

    Name Status Preview Comments Updated (UTC)
    openduck ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 3, 2024 9:44pm

    Comment on lines 151 to 162
    kwargs=dict(
    room_url=room_info["url"],
    username="Vikram (AI)",
    prompt=f"{request.prompt}.txt",
    voice_id=ELEVENLABS_VIKRAM,
    speak_first=True,
    username=personas[request.prompt]["username"],
    prompt=personas[request.prompt]["prompt"],
    tts_config=TTSConfig(
    provider=personas[request.prompt]["voice_provider"],
    voice_id=personas[request.prompt]["voice"],
    ),
    speak_first=personas[request.prompt]["speak_first"],
    context=context,
    room_id=room_info["id"],
    ),
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    kwargs=dict(
    room_url=room_info["url"],
    username="Vikram (AI)",
    prompt=f"{request.prompt}.txt",
    voice_id=ELEVENLABS_VIKRAM,
    speak_first=True,
    username=personas[request.prompt]["username"],
    prompt=personas[request.prompt]["prompt"],
    tts_config=TTSConfig(
    provider=personas[request.prompt]["voice_provider"],
    voice_id=personas[request.prompt]["voice"],
    ),
    speak_first=personas[request.prompt]["speak_first"],
    context=context,
    room_id=room_info["id"],
    ),
    kwargs={
    room_url=room_info["url"],
    username=personas[request.prompt]["username"],
    prompt=personas[request.prompt]["prompt"],
    tts_config=TTSConfig(
    provider=personas[request.prompt]["voice_provider"],
    voice_id=personas[request.prompt]["voice"],
    ),
    speak_first=personas[request.prompt]["speak_first"],
    context=context,
    room_id=room_info["id"],
    },

    @williamluer williamluer merged commit 890c9a1 into main Apr 3, 2024
    9 checks passed
    @williamluer williamluer deleted the will-voice-config branch April 3, 2024 21:50
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    None yet

    2 participants