how do i use agents built on different platform wi...
# ask-ai
a
how do i use agents built on different platform with livekit ? i read somewhere about creating a custom object ?
t
Thanks for reaching out, pavan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks so much for reaching out! To make sure I can support you in the best way possible, could you please help me understand a bit more about your situation? • What kind of external platform are you working with? For example, are you using agents built with Rasa, Dialogflow, custom REST APIs, or maybe another AI framework? • How are you thinking about integrating these? Are you planning to call external agent APIs from within a LiveKit agent, or do you want the external agents to join LiveKit rooms directly? • What kind of features or capabilities would you like these external agents to have inside the LiveKit environment? For instance, voice interaction, data exchange, media processing, or something else? • Are you aiming to migrate your existing agents over to LiveKit, or would you prefer to keep them on their original platforms while integrating? I'm here to help every step of the way, so feel free to share as much detail as you can! Sources: examples/avatar_agents/bithuman/README.md | agents/README.md | LiveKit Docs
a
i am using another framework to create my agents, but want to leverage livekit for streaming, and integrate my agent to livekit where livekit will take care of STT & TTS and just send the text input to the agent and get text response in streaming mode and use it to generate TTS response for user
t
I'm glad you're exploring how to integrate your external agent with LiveKit for STT and TTS! To make this work smoothly, you can create a custom LiveKit agent that serves as a bridge between LiveKit's audio processing and your external agent. Here's a friendly overview of how it all comes together: • Audio Input: LiveKit takes care of streaming audio and converting it to text using STT. • Text Processing: That text is then sent over to your external agent for processing. • Response Handling: Your external agent’s text response is streamed back to LiveKit, which uses TTS to turn it into audio output. Some key steps to keep in mind include: 1. Setting up LiveKit’s STT and TTS providers to handle transcription and audio generation. 2. Creating a custom agent within LiveKit to manage text input and communicate smoothly with your external agent. 3. Leveraging LiveKit’s streaming features to process real-time responses from your external agent and convert them back to audio. 4. Adding error handling and optimizing latency to ensure everything runs seamlessly. If you'd like, I’d be happy to walk you through any specific part of this process—whether it’s setting up the custom agent or managing the streaming responses. Just let me know how I can help! Sources: Text and transcriptions | LiveKit Docs | Pipeline nodes and hooks | LiveKit Docs | examples/other/text-to-speech/neuphonic_tts.py | How to Set Up Speech-to-Text Input with Text-Only Output in LiveKit Agents
a
give me detailed info or reference to docs for custom agents or custom objects to link to external agent
t
I'm glad you're interested in creating custom agents or objects in LiveKit and linking them to your external agent! LiveKit offers a really flexible framework to help you do just that. Here's a friendly guide to get you started: • Pipeline Nodes: You can customize nodes like
stt_node
,
llm_node
, and
tts_node
to take care of tasks such as transcription, text processing, and speech synthesis. • Lifecycle Hooks: Hooks like
on_enter
,
on_exit
, and
on_user_turn_completed
are great for managing how your agent behaves at different stages of interaction. • Tool Integration: Defining tools to connect with external APIs or services allows your agent to interact smoothly with other systems. • Streaming Responses: You can implement real-time streaming using LiveKit's
StreamAdapter
for TTS and handle text chunking to make speech sound natural. • Deployment: LiveKit provides deployment templates so you can easily run your custom agents in production environments like Kubernetes. For more detailed documentation and helpful examples, feel free to explore these resources: • Pipeline Nodes and Hooks • Tool Definition • External Data Integration • Workflows • Custom Deployment • Python Framework • Node.js Framework If you'd like, I’m here to help you with any specific part of this process—whether it’s setting up pipeline nodes or defining tools for your external agent. Just let me know how I can support you! Sources: External data and RAG | LiveKit Docs | avatars/hedra/education_avatar/agent.py | README.md | .cursor/rules/agent-core.mdc | Tool definition and use | LiveKit Docs