Awesome Reviewers

Reviewer · Documentation

Self-consistent code examples

When editing or simplifying a code example, make sure it stays fully consistent with its surrounding explanation and with the real, supported API. Concretely:

Instruction

When editing or simplifying a code example, make sure it stays fully consistent with its surrounding explanation and with the real, supported API. Concretely:

  1. If the prose describes a behavior or parameter (e.g., “each agent runs for many loops”), the accompanying snippet must demonstrate the corresponding setting, or the prose must be updated to match the simplified snippet. Don’t let text and code drift apart after an edit.
  2. Only import from the public, top-level API in examples. If a class or function is not yet re-exported publicly and only accessible via an internal path (e.g., from swarms.structs.planner_worker_swarm import PlannerWorkerSwarm), either fix the export, or add a short note that the top-level export is pending so readers aren’t pinned to an internal path. Also check other tables/lists in the doc referencing the same type for consistency.
  3. When an example depends on a non-obvious, required setting to actually work (e.g., a callback that silently no-ops unless a flag is set), add a one-line comment explaining why it’s needed, instead of leaving it unexplained:
# Agents must set streaming_on=True for streaming_callback to fire
agent = Agent(..., streaming_on=True)

Treat documentation code snippets as part of the API contract: review them together with the prose they illustrate, verify the imports are the ones users should actually use, and annotate any required-but-non-obvious configuration.</description> </invoke>