This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Billy. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To create an agent that warmly says "hello" and plays typing noise, you can use the following Python implementation:
Copy code
import asyncio
import logging
from dotenv import load_dotenv
from livekit.agents import (Agent, AgentSession, AudioConfig, BackgroundAudioPlayer, BuiltinAudioClip, JobContext, WorkerOptions, cli)
from livekit.plugins import openai

logger = logging.getLogger("typing-hello-agent")
load_dotenv()

class TypingHelloAgent(Agent):
    def __init__(self):
        super().__init__(instructions="You are a helpful assistant")

async def entrypoint(ctx: JobContext):
    await ctx.connect()
    logger.info('Connected to room')

    session = AgentSession(llm=openai.realtime.RealtimeModel())
    await session.start(TypingHelloAgent(), room=ctx.room)

    background_audio = BackgroundAudioPlayer(
        thinking_sound=[
            AudioConfig(BuiltinAudioClip.KEYBOARD_TYPING, volume=0.8),
            AudioConfig(BuiltinAudioClip.KEYBOARD_TYPING2, volume=0.7),
        ],
    )
    await background_audio.start(room=ctx.room, agent_session=session)

    await session.say("Hello. How can I help you today?", allow_interruptions=False)

if __name__ == "__main__":
    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
Make sure you’ve set up the necessary environment variables for the LiveKit server connection and API keys. If you have any questions or need a hand with anything else, please don’t hesitate to ask—I’m here to help! Sources: Node.js Agents Architecture | livekit/livekit_composite | DeepWiki | README.md | examples/voice_agents/langgraph_agent.py | Agent speech and audio | LiveKit docs
d
you removed the livekit code and theres not agent code like lllm tts stt
t
To create a LiveKit agent with LLM, TTS, and STT capabilities, you can use the following example:
Copy code
import {
  type JobContext,
  WorkerOptions,
  cli,
  defineAgent,
  voice,
} from '@livekit/agents';
import * as openai from '@livekit/agents-plugin-openai';
import * as elevenlabs from '@livekit/agents-plugin-elevenlabs';
import * as deepgram from '@livekit/agents-plugin-deepgram';

export default defineAgent({
  entry: async (ctx: JobContext) => {
    // Connect to the room
    await ctx.connect();

    // Create the agent
    const agent = new voice.Agent({
      instructions: 'You are a helpful assistant.',
      stt: new deepgram.STT(),
      llm: new openai.LLM({ model: 'gpt-4o-mini' }),
      tts: new elevenlabs.TTS(),
    });

    const session = new voice.AgentSession({
      stt: new deepgram.STT(),
      llm: new openai.LLM({ model: 'gpt-4o-mini' }),
      tts: new elevenlabs.TTS(),
    });

    await session.start({
      agent,
      room: ctx.room,
    });

    // Have the agent greet the user
    await session.say('Hello, how can I assist you today?');
  },
});

cli.runApp(new WorkerOptions({ agent: 'path-to-your-agent-file' }));
This example brings together LLM, TTS, and STT using plugins like OpenAI, ElevenLabs, and Deepgram to help you get started smoothly. If you have any questions or want to explore additional features, please feel free to ask—I'm here to help! Sources: examples/src/basic_tool_call_agent.ts | Ultravox plugin guide | LiveKit Docs | agent.py
d
...
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!