simple

Single Claude agent, one-shot

simple/claude.plumb
(* A simple chat with Claude *)

let claude : !string -> !string = agent {
  provider: "anthropic",
  model: "claude-haiku-4-5",
  runtime_context: true
}

let main : !string -> !string = plumb(input, output) {
  input ; claude ; output
}
simple/mistral.plumb
(* A simple chat with Mistral *)

let mistral : !string -> !string = agent {
  provider: "openai"
  model: "mistralai/mistral-large-2512"
  endpoint: "https://openrouter.ai/api/v1"
  runtime_context: true
}

let main : !string -> !string = plumb(input, output) {
  input ; mistral ; output
}
simple/claude.py
import plumbing as pb
from pathlib import Path
import asyncio

spec = Path(__file__).parent / "claude.plumb"

print(pb.call_sync(spec, "hello"))
simple/pydantic_agent.py
"""Simple Claude agent via Pydantic AI.

PlumbingModel is an interop adapter for the Pydantic AI ecosystem;
see claude.py for the canonical bare API interface.

Requires: ANTHROPIC_API_KEY

Usage:
    pip install plumbing[pydantic]
    ANTHROPIC_API_KEY=sk-... python pydantic_agent.py
"""

import asyncio
from pathlib import Path

from pydantic_ai import Agent

from plumbing.provider import PlumbingModel


async def main() -> None:
    spec = Path(__file__).parent / "claude.plumb"
    async with PlumbingModel(spec) as model:
        agent = Agent(model)
        result = await agent.run("Say hello in three words.")
        print(result.output)


if __name__ == "__main__":
    asyncio.run(main())