Context

Agent operational context.

Constructor


Context(
  self,
  current_input: str,
  messages: List[Dict[str, str]] = None,
  tool_results: Optional[List[Dict[str, Any]]] = None,
  max_history: Optional[int] = None
)
            

Methods

add_message

Add message to history with optional trace linkage.


add_message(self, role: str, content: str, trace_id: Optional[str] = None)
                    

add_tool_result

Add tool execution result to history.


add_tool_result(self, tool_name: str, args: dict, output: dict)
                    

get_clean_conversation

Returns conversation without execution trace data and internal JSON.


get_clean_conversation(self) -> List[Dict[str, str]]