/** * Defines decisions that a `DecisionModel` answers over a single input. * Pair an input schema with named classification, rating, or probability * decisions using `make`, then answer them with `DecisionModel.decide`, or * with `DecisionModel.decideSettled` to keep valid answers when others fail. * * @see {@link make} for building a definition from an input schema and decisions * * @stability unstable * @since 4.0.0 */ import type * as Result from "../Result.ts" import type * as Schema from "../Schema.ts" /** * Brand type for decision definitions. * * @stability unstable * @category type IDs * @since 4.0.0 */ export type TypeId = "~effect/ai/Decision" /** * Brand for decision definitions. * * @stability unstable * @category type IDs * @since 4.0.0 */ export const TypeId: TypeId = "~effect/ai/Decision" /** * Decision instructions or descriptions: a string, JSON object, or JSON array. * * **Details** * * TypeScript interfaces lack the index signature required by `Schema.JsonObject`; * use object literals, type aliases, or Schema types instead. * * @stability unstable * @category models * @since 4.0.5 */ export type Description = string | Schema.JsonObject | Schema.JsonArray /** * Decision that assigns the input one label out of a set of criteria. * `criteria` maps labels to descriptions; use `null` for a label without a description. * * @see {@link classify} for the constructor * @see {@link ClassifyAnswer} for the answer produced by this decision * * @stability unstable * @category models * @since 4.0.0 */ export interface Classify