fn.yml spec
A function is defined by a single fn.yml file. It is the source of truth for
its interface and behavior.
name: classify
version: 3
model: claude-opus-4-8
input:
ticket: file
output:
category: string
priority: enum[low, high]
confidence: number
eval:
dataset: ./tickets.jsonl
threshold: 0.95
runs: 5
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Function identifier, lowercase, URL-safe |
version | integer | yes | Monotonic version number |
model | string | yes | Target model id |
input | map of typed fields | yes | Named, typed inputs |
output | map of typed fields | yes | Named, typed outputs (the structured result) |
eval | object | no | Dataset, threshold, and run count |
Field types
Inputs and outputs are typed. Supported types:
| Type | Notes |
|---|---|
string | UTF-8 text |
number | Floating point |
boolean | true / false |
enum[a, b, ...] | One of a fixed set of string values |
file | A file reference (PDF, CSV, log, image) |
array[<type>] | A list of any of the above |
TypeScript types
The compiled function's I/O is also available as TypeScript, generated by
fn types:
export interface ClassifyInput {
ticket: File;
}
export interface ClassifyOutput {
category: string;
priority: "low" | "high";
confidence: number;
}