Skip to main content
This page is the public import contract for application developers. Use these imports in docs, examples, tests that exercise public behavior, and downstream applications. For field-by-field configuration, see Configuration Reference. For generated module detail, see Full Module Reference.

Import map

Do not use src.afk.* imports in user-facing docs.

Agent

Only model is required. Most examples should also set name and instructions for clear traces and predictable behavior.

Runner

Common methods: run_sync() is a convenience wrapper for synchronous code. Use await runner.run(...) inside async applications.

RunnerConfig

Use Configuration Reference for the complete set of runner fields and defaults.

FailSafeConfig

Set max_total_cost_usd for production agents. The default is intentionally unset because acceptable budgets vary by application.

Tool decorator

Tool functions may be sync or async. They may accept (args), (args, ctx), or (ctx, args).

AgentResult

Important fields:

API stability

  • Public docs and examples should use imports from afk.agents, afk.core, afk.tools, afk.llms, afk.memory, afk.queues, afk.mcp, afk.messaging, afk.observability, and afk.evals.
  • Internal modules under package subdirectories may change faster than public exports.
  • When changing public exports, update this page, Public API Rules, examples, and generated agent-facing docs.