UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

52 lines • 2.31 kB
"use strict"; /** * agentfootprint/classify — a calibrated judge you plug in. * * A classifier is not a model that generates text. Handed a state and a set * of typed questions — pick one of these options, is this true, where on * this scale — it scores the DECLARED candidates from one reading and * answers with a distribution, a confidence, a probability. The answer comes * with its evidence, and the schema holds by construction * (docs/design/2026-09-scored-choice.md). * * Two places the agent spends one: * * • `.findings({ judge })` — a second source on the findings ledger: after * every tool result the judge is asked what that result is worth for the * proposition the model declared (or the user's question), and its * standing, distribution, confidence and cost land as a `JudgmentRow` * beside the model's own standing. Two sources, two rows, never merged. * • `classifierScorer(classifier)` on `agentfootprint/skill-graph` — an * `EntryScorer` whose ranking IS the provider's distribution. * * Adapters: `typesafe()` (TypeSafe "System One", model `jev`; key from * `TYPESAFE_API_KEY`) and `mockClassifier()` for tests and the bench. Bring * your own by implementing `Classifier`. * * @example * ```ts * import { typesafe } from 'agentfootprint/classify'; * * const agent = Agent.create({ provider, model }) * .tool(search) * .findings({ judge: typesafe() }) * .build(); * ``` */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("../classify/index.js"), exports); //# sourceMappingURL=classify.js.map