hello, how to get session/agent history properly i...
# agents
f
hello, how to get session/agent history properly in stt/tts module? when initializing the agent , i provided history chat_ctx of 13 items, something like
Agent(chat_ctx=[....]
in stt, i use following code to get the current session
Copy code
session = get_job_context()._primary_agent_session
items = session.history.items
however the items size starts from 1, missing the chat_ctx i provided
l
session.history.items
only contains the chat since the agent was initialized. Can you try
session.current_agent.chat_ctx.items
? That should give you the full context
f
yes,it is working great now