Agent Wranglers

DOC-25Recommended

Show each API example in every language you ship an SDK for

Give every API example in the docs one version per official SDK language, plus a raw HTTP request. Test each version in that SDK's own test run.

How to do it

A reader who uses Python skips a page that shows only JavaScript. Keep the languages in one list, and let the docs build fail when an example lacks one. Store each version as a test file in the SDK repository. Include it in the page from there, so the docs show code that passed. Base the raw request on the contract's own example, as Give every endpoint an example says. Keep each version complete, as Make every example complete enough to copy and run says.

Examples

JavaScript example

import { Bakery } from '@example/bakery';

const bakery = new Bakery({ apiKey: process.env.BAKERY_API_KEY });
const order = await bakery.orders.get('10423');
console.log(order.status);

Python example

import os
from example_bakery import Bakery

bakery = Bakery(api_key=os.environ["BAKERY_API_KEY"])
order = bakery.orders.get("10423")
print(order.status)

How to check

The docs build reads the list of SDK languages. Every example group has a block for each language and one for HTTP. Each block comes from a test file that passed in the last SDK run.

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/documentation/examples-that-run/examples-per-sdk">Agent Wranglers documentation playbook</a>. In code you write, add a comment next to it with the same link.