Hi! I haven't checked the LiveKit docs for a coup...
# agents
a
Hi! I haven't checked the LiveKit docs for a couple of months (since around
livekit-agents 1.2.9
) and I've just noticed this new "agent server" (never heard of it before, although I have agents built with the LiveKit Agents framework running in production). Before, this was just called "worker". And it seems that the way to initialise a "worker" and an "agent server" is different. Am I hallucinating, or is this a real thing? 😄 Is there a migration guide somewhere?
🙌 1
From the Releases I could now find that this was introduced in livekit-agents@1.3.3. But the comments are not saying much besides:
Copy code
New AgentServer API
We've renamed Worker to AgentServer, and you now need to use a decorator to define the entrypoint. All existing functionality remains backward compatible. This change lays the groundwork for upcoming design improvements and new features.

server = AgentServer()

def prewarm(proc: JobProcess): ...
def load(proc: JobProcess): ...

server.setup_fnc = prewarm
server.load_fnc = load

@server.rtc_session(agent_name="my_customer_service_agent")
async def entrypoint(ctx: JobContext): ...
I wasn't able to find more useful information around this.
@boundless-energy-78552
Thank you in advance for shedding some light on this 🙏
@lively-winter-88668
@refined-appointment-81829
Again, thanks in advance for any information about this.
l
Hey @adamant-sandwich-74490, there's no migration guide because everything should be backwardly compatible. What the docs team did instead was to completely rewrite the docs at https://docs.livekit.io/agents/server/ to only describe Agent server. By way of some explanation, and at the risk of revealing the 'sausage making', this change coincided with the release of 3 major product launches (agent observability, phone numbers, agent builder) so a migration guide didn't get prioritised, especially since we aren't requiring a change in code. Other than making the interface a lot cleaner, it also lays the ground work for new features such as https://docs.livekit.io/agents/logic/tasks/#taskgroup (still in beta)
a
I see, thanks for the clarification, @lively-winter-88668! Would it make sense to add a short note in the docs about this change, so that people don't get confused? It might be a tad confusing otherwise for people like me that have been working with the framework for some time but missed the aforementioned release changelog. Something along the lines of "please note that Workers have been renamed to Agent Servers, which remain completely backwards compatible but have a slightly different interface, to help move towards a cleaner and more future-proof architecture for new upcoming features".
l
That's a fair ask, can I please ask you to repost the above to #C09GBJY83C7?
✅ 1