Hi, can anyone tell what context.session.agent_sta...
# agents
p
Hi, can anyone tell what context.session.agent_state do as I want to update my agent state, as my agent is not at all working in my flow?
l
Agent state is read-only, it is not something you set, but rather is used to report to your application what the Agent is doing, e.g.
Copy code
def on_agent_state_changed(ev: AgentStateChangedEvent):
    if ev.new_state == "initializing":
        print("Agent is starting up")
    elif ev.new_state == "idle":
        print("Agent is ready but not processing")
    elif ev.new_state == "listening":
        print("Agent is listening for user input")
    elif ev.new_state == "thinking":
        print("Agent is processing user input and generating a response")
    elif ev.new_state == "speaking":
        print("Agent started speaking")