Process Task Context • AI Agent SDK
process_task_context: Process a single context item for task execution.
process_task_context
Function
</div>
This function is defined in the agents module.
Process a single context item for task execution. This helper function avoids code duplication between async and sync execution methods.
Signature
def process_task_context(context_item: Any, verbose: Any, user_id: Any) -> AnyParameters
ParamField
AnyThe context item to process (can be string, list, task object, or dict)
ParamField
AnyVerbosity level for logging
ParamField
AnyUser ID for database queries
Returns
ResponseField
AnyFormatted context string for this item
Uses
logger.debugjson.loadsKnowledgeknowledge.search
Source
View on GitHubpraisonaiagents/agents/agents.py at line 679