mirror of
https://github.com/livekit/livekit.git
synced 2026-09-05 21:15:04 +00:00
Update README to include snippet about Agents (#4808)
* Add Agents snippet to README. Added important information about LiveKit Agents SDK for building Voice AI, including a code example and links to relevant documentation. * Add tags for snippet
This commit is contained in:
@@ -23,6 +23,39 @@ LiveKit's server is written in Go, using the awesome [Pion WebRTC](https://githu
|
||||
[](https://github.com/livekit/livekit/actions/workflows/buildtest.yaml)
|
||||
[](https://github.com/livekit/livekit/blob/master/LICENSE)
|
||||
|
||||
<!--BEGIN_AGENTS_INFO-->
|
||||
> [!IMPORTANT]
|
||||
> If you're building Voice AI, [LiveKit Agents](https://github.com/livekit/agents) is the SDK for code-first realtime voice agents. STT, LLM, TTS, turn detection, [expressive speech](https://docs.livekit.io/agents/models/tts/expressive/), [keyterm accuracy](https://docs.livekit.io/agents/models/stt/keyterms/), tool usage, and telephony all come bundled in the framework. It's available in both [Python](https://github.com/livekit/agents) and [Node.js](https://github.com/livekit/agents-js).
|
||||
>
|
||||
>```python
|
||||
># agent.py
|
||||
>from livekit import agents
|
||||
>from livekit.agents import Agent, AgentServer, AgentSession, STTContextOptions, TurnHandlingOptions, inference
|
||||
>
|
||||
>server = AgentServer()
|
||||
>
|
||||
>
|
||||
>@server.rtc_session(agent_name="my-agent")
|
||||
>async def my_agent(ctx: agents.JobContext):
|
||||
> session = AgentSession(
|
||||
> stt=inference.STT(model="deepgram/nova-3", language="multi"),
|
||||
> llm=inference.LLM(model="google/gemma-4-31b-it"),
|
||||
> tts=inference.TTS(model="inworld/inworld-tts-2", voice="Ashley"),
|
||||
> turn_handling=TurnHandlingOptions(turn_detection=inference.TurnDetector()),
|
||||
> stt_context_options=STTContextOptions(keyterms=["LiveKit", "Acme Corp"]),
|
||||
> expressive=True,
|
||||
> )
|
||||
> await session.start(room=ctx.room, agent=Agent(instructions="You are a helpful voice AI assistant."))
|
||||
> await session.generate_reply(instructions="Greet the user and offer your assistance.")
|
||||
>
|
||||
>
|
||||
>if __name__ == "__main__":
|
||||
> agents.cli.run_app(server)
|
||||
>```
|
||||
>
|
||||
>Models come from [LiveKit Inference](https://docs.livekit.io/agents/models/) with no per-provider API keys, and LiveKit Cloud handles [deployment](https://docs.livekit.io/deploy/agents/) and [observability](https://docs.livekit.io/deploy/observability/). Visit the docs for more info at [docs.livekit.io/agents](https://docs.livekit.io/agents/).
|
||||
<!--END_AGENTS_INFO-->
|
||||
|
||||
## Features
|
||||
|
||||
- Scalable, distributed WebRTC SFU (Selective Forwarding Unit)
|
||||
|
||||
Reference in New Issue
Block a user