xiaozhi-esp32-server/main/livekit-server/src/agent/main_agent.py
rahulpscraftech360 b1052306b3 feat: Add LiveKit server integration with sanitized configuration
- Added LiveKit server with proper folder structure
- Integrated MQTT gateway for ESP32 communication
- Added agent with STT/TTS capabilities
- Sanitized .env.example with placeholder API keys
- Updated project configuration files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 16:29:15 +05:30

25 lines
No EOL
936 B
Python

import logging
from livekit.agents import (
Agent,
RunContext,
function_tool,
)
logger = logging.getLogger("agent")
class Assistant(Agent):
"""Main AI Assistant agent class"""
def __init__(self) -> None:
super().__init__(
instructions="""You are a helpful voice AI assistant.
You eagerly assist users with their questions by providing information from your extensive knowledge.
Your responses are concise, to the point, and without any complex formatting or punctuation including emojis, asterisks, or other symbols.
You are curious, friendly, and have a sense of humor.""",
)
@function_tool
async def lookup_weather(self, context: RunContext, location: str):
"""Look up weather information for a specific location"""
logger.info(f"Looking up weather for {location}")
return "sunny with a temperature of 70 degrees."