mirror of
https://github.com/livekit/agents.git
synced 2026-12-04 09:08:37 +00:00
Agent took deps_type and state_type but nothing read them: the framework loads state with the door's type, and a type checker could not use them because Agent was not generic. run() took Any and returned RunResult[Any], so a wrong state or deps object and a typo on a structured output all passed the type checker. Agent is now generic, the three parameters read from those arguments and Any when one is left out, so a bare Agent annotation and a subclass keep working. run(), stream(), @agent.instructions and @agent.output_validator carry the types, and agent.run(state=ctx.state) checks the door's state type against the agent's. tests/type_checks/agent_generics.py pins this: each expected error has a type: ignore[code], and scripts/check_types.py checks the package, so it fails both when a check is lost and when a new error appears.
Fast brain, slow brain
A front desk talks to the person, by text and on the phone; its one tool delegates over A2A to a back office that holds the system and does the work.
| Example | What |
|---|---|
frontdesk/ |
A dental practice's scheduling: two tools and a booking that asks for what it is missing. |
hotel-receptionist/ |
A hotel's bookings, lookups and cancellations: guided flows, verification, approval on writes. |
airline-support/ |
An airline's customer care: a graph that asks for what is missing, EU261 in code, payment after approval. |
Running them
Follow the Getting started: install from PyPI, set the staging
project's keys, then python main.py dev in an example's directory (python support_agent.py dev
for the airline) and talk to it in the console.