can I access unique identifier ("job_id") from pyt...
# ask-ai
f
can I access unique identifier ("job_id") from python agent session?
t
Thanks for reaching out, Taras. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Absolutely, a Python agent session can access the unique identifier
job_id
. You’ll find this through the
JobContext
object, which gives you all the details about the current job. Specifically, the
job
property inside
JobContext
holds the
id
field that matches the
job_id
. To get the
JobContext
during an agent session, you can use the
get_job_context()
function. Also, just so you know, the job ID is included in the JSON-formatted logs that each job outputs, which can be really handy for logging and diagnostics. Sources: livekit-agents/livekit/agents/ipc/job_executor.py | Job lifecycle | LiveKit Docs