main • AI Agent SDK
Module reference for main
main
AI Agent
Import
from praisonaiagents import mainClasses
Functions
Register a synchronous or asynchronous callback function for a specific display type.
register_approval_callback()Register a global approval callback function for dangerous tool operations.
execute_sync_callback()Execute synchronous callback for a given display type without displaying anything.
execute_callback()Execute both sync and async callbacks for a given display type.
display_interaction()Synchronous version of display_interaction.
display_self_reflection()Function definition.
display_instruction()Function definition.
display_tool_call()Display tool call information in PraisonAI’s unique timeline format.
display_error()Function definition.
display_generating()Function definition.
display_reasoning_steps()Display reasoning steps with unique numbered circles.
display_working_status()Display animated working status with pulsing dots.
adisplay_interaction()Async version of display_interaction.
adisplay_self_reflection()Async version of display_self_reflection.
adisplay_instruction()Async version of display_instruction.
adisplay_tool_call()Async version of display_tool_call.
adisplay_error()Async version of display_error.
adisplay_generating()Async version of display_generating.
clean_triple_backticks()Remove triple backticks and surrounding json fences from a string.
Constants
| Name | Value |
|---|---|
MAX_ERROR_LOGS | 1000 |
PRAISON_COLORS | {'agent': '#86A789', 'agent_text': '#D2E3C8', 'task': '#FF9B9B', 'task_text': '#FFE5E5', 'working': '#FFB347', 'working_text': '#FFF3E0', 'response': '#4A90D9', 'response_text': '#E3F2FD', 'tool': '#9... |
WORKING_FRAMES | ['●○○', '○●○', '○○●', '○●○'] |
WORKING_PHASES | ['Analyzing query...', 'Processing context...', 'Generating response...', 'Finalizing output...'] |
SUPPORTED_CALLBACK_TYPES | ['tool_call', 'interaction', 'error', 'llm_start', 'llm_end', 'llm_content', 'autonomy_iteration', 'autonomy_stage_change', 'autonomy_doom_loop', 'autonomy_complete', 'retry'] |