[docs]classContext(BaseModel):""" Holds all contextual information for a single agent invocation. This object is created by the Runner and passed through the agent execution flow, providing access to necessary services and data, including a live request queue for real-time interaction. """model_config=ConfigDict(arbitrary_types_allowed=True,extra="forbid",)# Core contextuser_id:strsession:Session=Session(id="",user_id="")activate_tools:list=[]new_message:Optional[Message]=Nonecurrent_messages:List[Message]=[]request:AgentRequestnew_message_dict:Optional[Dict]=Nonemessages_list:List[Dict]=[]# Services available to the agentenvironment_manager:Optional[EnvironmentManager]=Nonecontext_manager:Optional[ContextManager]=None# Agent specific configagent:Agentagent_config:Optional[dict]=None@propertydefmessages(self):ifself.new_message_dict:returnself.messages_list+[self.new_message_dict]else:returnself.messages_list