async def main(): """ Simple example demonstrating context debugging. """ print("\n" + "="*70) print("🚀 SIMPLE ADK CONTEXT DEBUGGER") print("="*70) print("This example shows how to debug the LLM context.") print("="*70 + "\n") # Create agent with debug callback agent = Agent( name="debug_agent", model="gemini-2.0-flash-exp", instruction="You are a helpful assistant. Use the information provided above to answer questions.", before_model_callback=debug_and_inject_context ) # Create runner with in-memory sessions runner = Runner( app_name="simple_debug_app", agent=agent, session_service=InMemorySessionService() ) user_id = "user123" session_id = "session456" # Create session with some initial state await runner.session_service.create_session( app_name="simple_debug_app", user_id=user_id, session_id=session_id, state={ "location": "San Francisco", "membership_level": "premium" } ) # Interactive loop print("Type 'exit' to quit\n") while True: query = input("👤 YOU: ").strip() if query.lower() == 'exit': break if query: # Only process non-empty input await run_turn(runner, user_id, session_id, query) if __name__ == "__main__": asyncio.run(main()) __ __