Skip to main content

process

Method
This is a method of the ContextManager class in the manager module.
Process messages through the context pipeline. Applies budgeting, optimization, and monitoring.

Signature

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

messages
List
required
Conversation messages
system_prompt
str
default:"''"
System prompt content
tools
Optional
Tool schemas
trigger
Literal
default:"'turn'"
What triggered this processing

Returns

Returns
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 391