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

python
def process_task_context(context_item: Any, verbose: Any, user_id: Any) -> Any

Parameters

ParamField Any

The context item to process (can be string, list, task object, or dict)

ParamField Any

Verbosity level for logging

ParamField Any

User ID for database queries

Returns

ResponseField Any

Formatted context string for this item

Uses

  • logger.debug
  • json.loads
  • Knowledge
  • knowledge.search

Source

View on GitHub

praisonaiagents/agents/agents.py at line 679


Related Documentation