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

Add voice chat extension #1022

Merged
merged 3 commits into from
Oct 1, 2023
Merged

Add voice chat extension #1022

merged 3 commits into from
Oct 1, 2023

Conversation

Josh-XT
Copy link
Owner

@Josh-XT Josh-XT commented Oct 1, 2023

Add voice chat extension

  • Abstracts away the need to find the specific TTS provider for the agent on the front end.

Text-To-Speech providers and the order they're chosen

  • Uses Streamlabs TTS with Brian voice by default.
  • If USE_GTTS is true for the agent, it will take precedence over Streamlabs TTS
  • If USE_HUGGINGFACE_TTS is true for the agent and it has a HUGGINGFACE_API_KEY, it will use the selected audio model on Hugging Face from the agent settings.
  • If ELEVENLABS_API_KEY is not empty, ElevenLabs TTS will be used.

Python Usage Example

    import os
    from agixtsdk import AGiXTSDK

    ApiClient = AGiXTSDK(base_uri="http://localhost:7437", api_key="")
    # Get base64 audio from audio.wav and send it to the agent.
    with open(os.path.join(os.getcwd(), "audio.wav"), "rb") as audio_file:
        base64_audio = audio_file.read()

    ApiClient.execute_command(
        agent_name="gpt4free",
        command_name="Chat with Voice",
        command_args={
            "base64_audio": base64_audio,
            "conversation_results": 3,
            "context_results": 10,
        },
        conversation_name="Voice chat",
    )

TypeScript Usage Example

See the component that uses this in the NextJS front end.

https://github.com/AGiXT/nextjs/blob/main/components/systems/command/AudioRecorder.js

@Josh-XT Josh-XT merged commit 3bf8c33 into main Oct 1, 2023
@Josh-XT Josh-XT deleted the Add-voice-chat branch October 1, 2023 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant