Search by

Stable AI contracts for Switon Framework (shared primitives; not providers or agent loop)

v1.0.0 2026-08-22 14:29 UTC

This package is auto-updated.

Last update: 2026-11-23 14:47:03 UTC


README

CI PHP 8.3+

Stable AI wire contracts for Switon — shared primitives above core, below providers (llm), tool registry (tooling), catalog (agents), skill catalog (skill), thread, MCP client, and agency.

Highlights

  • Wire contracts: messages, tool calls, streaming fragments, and token counts.
  • Boundary: providers, the tool registry, catalogs, thread storage, and the agent loop stay outside.
  • Inbox: one piece of mail, the model id, and the chosen effort.
  • Suspend: a turn can wait for a tool reply, a host review, or a retry, then continue.
  • Drop a turn: remove it from working memory.

Installation

composer require switon/ai

Quick Start

use Switon\Ai\AgentInterface;
use Switon\Ai\Envelope;

/** @var AgentInterface $agent */
$agent->deliver(Envelope::of('hi', 'main'));
$turn = $agent->run(Envelope::of('hi', 'main'));

Docs: https://github.com/switon-php/ai/blob/main/docs/README.md

License

MIT.