@pathmx/ai
v0.7.7
Published
Named AI models for PathMX Plugins, called through an admitted View.
Readme
@pathmx/ai
Named AI models for PathMX Plugins. Requests go through an admitted View, stream
partial results, validate structured output, run AI SDK tools in a bounded loop,
generate images and map provider failures to durable job outcomes. For agents
authored as Markdown Actors, see @pathmx/agents.
bun add @pathmx/ai aiCreate one service and pass it to the Plugins that use it:
import { createGateway } from "ai"
import { AI } from "@pathmx/ai"
const gateway = createGateway({ apiKey: process.env.AI_GATEWAY_API_KEY })
export const ai = AI({ models: { tutor: gateway("provider/model-name") } })A Plugin then asks through the View it admitted, such as
ai.generate({ view, model: "tutor", input: [lesson, question] }).output.
Keep @pathmx/ai on the same version as your other PathMX packages. See the
AI reference for requests,
tools, images, usage and durable jobs.
