thousands-night-79795
06/24/2025, 1:55 PMtall-airline-16756
06/24/2025, 1:55 PMtall-airline-16756
06/24/2025, 1:55 PMagentName
accessor property of a JobRequest
object. This property returns the agent's name as a string, which was set in the WorkerOptions
when configuring the agent.
Here is an example:
// Example of accessing the agent name
const agentName = jobRequest.agentName;
Sources: JobRequest | LiveKit Agentsthousands-night-79795
06/24/2025, 1:56 PMtall-airline-16756
06/24/2025, 1:57 PMJobRequest
class in the LiveKit Agents Python library. Think of it like a friendly job dispatcher that helps workers manage their assignments. It's pretty neat - you'll use this class to handle incoming jobs and decide whether to jump in or pass.
Here's a peek at how it gets set up:
def __init__(
self,
*,
job: agent.Job,
on_reject: Callable[[], Coroutine[None, None, None]],
on_accept: Callable[[JobAcceptArguments], Coroutine[None, None, None]],
) -> None:
self._job = job
self._lock = asyncio.Lock()
self._on_reject = on_reject
self._on_accept = on_accept
Most of the time, you'll be working with this inside your worker setup. Curious about how it all comes together? I'm totally happy to chat more and break it down for you! Just ask, and I'll help you make sense of it.
Sources: GitHub:: LiveKit Composite Repo | livekit/agents/livekit-agents/livekit/age... | GitHub::LiveKit Agents | livekit-agents/livekit/agents/worker.pythousands-night-79795
06/24/2025, 1:58 PMtall-airline-16756
06/24/2025, 1:59 PMJobRequest
and JobContext
in the LiveKit Python library. While I couldn't find a definitive answer right away, I'm here to help. If you can share a bit more about what you're working on, I'll do my best to guide you or connect you with someone who can provide more specific insights. We'll figure this out together!thousands-night-79795
06/24/2025, 2:00 PMtall-airline-16756
06/24/2025, 2:00 PMJobRequest
from an Agent
in LiveKit Python is totally doable. Let me break it down for you in a friendly way. It usually happens when you're handling incoming job messages - super straightforward! When a job message comes in, you'll create a JobRequest
object like this:
job_req = JobRequest(job=msg.job, on_reject=_on_reject, on_accept=_on_accept)
Here's what each part means:
• `job`: The details of the job from the message
• `on_reject`: What happens if the job gets turned down
• `on_accept`: What happens when the job is accepted
Need me to explain anything else? I'm here to help, so just ask!
Sources: GitHub:: LiveKit Composite Repo | livekit/livekit/pkg/agent/client.go | GitHub::LiveKit Agents | livekit-agents/livekit/agents/worker.py