process • AI Agent SDK

process: Process messages through the context pipeline.

process

Method

</div>

This is a method of the ContextManager class in the manager module.

Process messages through the context pipeline.

Applies budgeting, optimization, and monitoring.

Signature

python
def process(messages: List[Dict[str, Any]], system_prompt: str, tools: Optional[List[Dict[str, Any]]], trigger: Literal['turn', 'tool_call', 'manual', 'overflow']) -> Dict[str, Any]

Parameters

ParamField List

Conversation messages

ParamField str

System prompt content

ParamField Optional

Tool schemas

ParamField Literal

What triggered this processing

Returns

ResponseField Dict[str, Any]

Dict with processed messages and metadata

Uses

  • reset
  • track_system_prompt
  • track_tools
  • track_history
  • get_utilization
  • get_total
  • get_warnings
  • estimate_messages_tokens

Source

View on GitHub

praisonaiagents/context/manager.py at line 324