github livekit/agents livekit-agents@1.2.2

one month ago

Note

livekit-agents 1.2 introduced many new features. You can check out the changelog here.

New features

SpeechHandle

Waiting for the playout to finish inside the function tools could lead to deadlocks. In this version, an error will be raised instead. To wait for the assistant's spoken response prior of executing a tool, use RunContext.wait_for_playout.

@function_tool
async def my_function_tool(self, ctx: RunContext):
    await ctx.wait_for_playout() # wait for the assistant's spoken response that started the execution of this tool

False interruption detection

We're now emitting an event when the agent got interrupted, but we didn't receive any transcript. (Likely a false interruption).
This is useful to "re-regenerate" an assistant reply so the agent doesn't seems stuck.

@session.on("agent_false_interruption")
def on_false_interruption(ev: AgentFalseInterruptionEvent):
    session.generate_reply(instructions=ev.extra_instructions or NOT_GIVEN)

Initial conversation recording

We have begun implementing conversation recording directly within the Worker. Currently, it can be accessed using the console subcommand. A future update will provide API to use this in production.

python3 examples/drive-thru/drivethru_agent.py console --record

What's Changed

New Contributors

Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.2.0...livekit-agents@1.2.2

Don't miss a new agents release

NewReleases is sending notifications on new releases.