.debug()
.debug()
Section titled “.debug()”AgentForceAgent Optional Chainable
Enable debug logging for the agent to output configuration details and runtime information. Currently logs agent name, provider, and model configuration.
Signature
Section titled “Signature”debug(): AgentForceAgent
Returns
Section titled “Returns”Returns the AgentForceAgent
instance for method chaining.
Examples:
Section titled “Examples:”Basic Usage
Section titled “Basic Usage”import { AgentForceAgent } from '@agentforce/adk';
const agent = new AgentForceAgent({ name: "MyAgent"}) .useLLM("ollama", "gemma3:4b") .systemPrompt("You are a helpful assistant") .debug() // Logs: name, provider, model .prompt("Hello world");
const response = await agent.output("text");
import { AgentForceAgent } from '@agentforce/adk';
const agent = new AgentForceAgent({ name: "DebugAgent", tools: ["fs_read_file"]}) .useLLM("google", "gemini-1.5-flash") .systemPrompt("You are a code reviewer") .task("Read the main.ts file") .task("Analyze the code structure") .debug() // Enable debug logging .prompt("Review this TypeScript code");
await agent.run();
Method Chaining
Section titled “Method Chaining”The debug()
method supports fluent chaining and can be placed anywhere in the chain:
const agent = new AgentForceAgent({ name: "ChainedAgent" }) .debug() // Can be called early .useLLM("ollama", "phi4-mini:latest") .systemPrompt("You are an assistant") .debug() // Or called multiple times .prompt("Test prompt");
Related Methods
Section titled “Related Methods”.useLLM()
- Configure LLM provider (logged by debug).systemPrompt()
- Set system instructions.task()
- Add tasks to execution queue.run()
- Execute agent with debug output