Debug
You can set the debug mode on the agent for all runs to have more verbose output.
Debug.
1"""2Debug3=============================45Debug.6"""78from kern.agent import Agent9from kern.models.openai import OpenAIResponses1011# You can set the debug mode on the agent for all runs to have more verbose output12# ---------------------------------------------------------------------------13# Create Agent14# ---------------------------------------------------------------------------15agent = Agent(16 model=OpenAIResponses(id="gpt-5-mini"),17 debug_mode=True,18)1920# ---------------------------------------------------------------------------21# Run Agent22# ---------------------------------------------------------------------------23if __name__ == "__main__":24 agent.print_response(input="Tell me a joke.")2526 # You can also set the debug mode on a single run27 agent = Agent(28 model=OpenAIResponses(id="gpt-5-mini"),29 )30 agent.print_response(input="Tell me a joke.", debug_mode=True)Run the Example
1# Clone and setup repo2git clone https://github.com/kern-ai/kern.git3cd kern/cookbook/02_agents/14_advanced45# Create and activate virtual environment6./scripts/demo_setup.sh7source .venvs/demo/bin/activate89python debug.py