Create a new project and install dependencies. uv will automatically set up a virtual environment and manage your packages.
uv init my-voice-agent && cd my-voice-agentuv add cartesia-line
Create main.py:
import osfrom line.llm_agent import LlmAgent, LlmConfig, end_callfrom line.voice_agent_app import VoiceAgentAppasync def get_agent(env, call_request): return LlmAgent( model="anthropic/claude-haiku-4-5-20251001", # Or "gpt-5-nano", "gemini/gemini-2.5-flash", etc. api_key=os.getenv("ANTHROPIC_API_KEY"), tools=[end_call], config=LlmConfig( system_prompt="You are a helpful assistant.", introduction="Hello! How can I help you today?", ), )app = VoiceAgentApp(get_agent=get_agent)if __name__ == "__main__": app.run()