import type { MessageBatchRequest } from "#tools/anthropic/batches"; /** * What a variant name is in relation to the place that holds it. */ export declare const VariantNameRole: { /** * A respelling of the place's own primary name, such as `Cross Roads` on `Crossroads`. */ readonly Spelling: "same_place_spelling"; /** * An earlier name of the same settlement. */ readonly Former: "same_place_former"; /** * Another name in present use for the same settlement. */ readonly Alternate: "same_place_alternate"; /** * The name of a separate community, standing or absorbed, near the holder. */ readonly OtherPlace: "other_place"; /** * The name of a post office, station, landing, mine or other feature that isn't a settlement. */ readonly Feature: "feature"; /** * The evidence supplied and the model's recall decide no role. */ readonly Unknown: "unknown"; }; export type VariantNameRole = (typeof VariantNameRole)[keyof typeof VariantNameRole]; /** * What a label rests on. */ export declare const LabelBasis: { /** * The model recalls this specific place's naming history. */ readonly Known: "known"; /** * The supplied collision and distance decide it. */ readonly Context: "context"; /** * Only the shape of the two strings decides it. */ readonly Form: "form"; }; export type LabelBasis = (typeof LabelBasis)[keyof typeof LabelBasis]; declare const CONFIDENCES: readonly ["high", "medium", "low"]; export type LabelConfidence = (typeof CONFIDENCES)[number]; /** * One variant name with the evidence the model reads beside it. */ export interface VariantNameItem { /** * The holder's WOF id. */ wofID: number; /** * The variant name as the `names` table writes it. */ name: string; /** * The `names.language` of the row, `und` for a GNIS variant. */ language: string; /** * The holder's primary name. */ holder: string; county: string | null; region: string | null; latitude: number; longitude: number; /** * The holder's other variant names. */ siblings: string[]; /** * The count of other US localities whose primary name has this name's key. */ collisions: number; /** * The nearest of those localities, or `null` when the count is zero. */ nearest: { wofID: number; name: string; county: string | null; region: string | null; km: number; } | null; } /** * A label states the role the model assigned to one item, what the role rests on, * and the model's confidence. */ export interface VariantNameLabel { role: VariantNameRole; basis: LabelBasis; confidence: LabelConfidence; } /** * The system prompt of every name-role request states the six roles, the three bases, * and the rule that a locality holding the variant as its primary name within about * 15 kilometers is evidence of a separate community. */ export declare const NAME_ROLE_SYSTEM_PROMPT = "You label variant names of United States populated places for a gazetteer.\n\nEach item is one variant name that the USGS Geographic Names Information System or Who's On First records on a locality. A geocoder returns the locality when a user types the variant, so the gazetteer needs to know what the variant is. Some variants are earlier or alternate names of the same settlement. Others are the names of separate communities that a record absorbed, and many of those are also the primary name of a different locality elsewhere.\n\nFor each item you receive: the variant name, the locality that holds it with its county, state and coordinates, the locality's other variant names, the number of other US localities whose primary name is this variant, and the nearest of those with its distance in kilometers.\n\nAssign one role:\n- same_place_spelling: a respelling, spacing, punctuation or abbreviation difference of the holder's own primary name.\n- same_place_former: an earlier name of the same settlement.\n- same_place_alternate: another name in present use for the same settlement.\n- other_place: the name of a separate community, standing today or absorbed, including a neighboring settlement that the nearest collision identifies.\n- feature: the name of a post office, railroad station, landing, mine, camp or other feature that was never the settlement's name.\n- unknown: neither your knowledge of the place nor the supplied evidence decides.\n\nState the basis: \"known\" when you recall this specific place's naming history, \"context\" when the supplied collision and distance decide it, \"form\" when only the two strings decide it. State your confidence as high, medium or low. A nearby locality with the variant as its primary name, within about 15 kilometers, is strong evidence for other_place. A collision hundreds of kilometers away is a coincidence of common names and decides no role. Prefer unknown at low confidence over a guess.\n\nReturn one label per item, with the item's index."; /** * The structured-output schema of one response: a label per item, addressed * by the item's index in the request. */ export declare const NAME_ROLE_RESPONSE_SCHEMA: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["labels"]; readonly properties: { readonly labels: { readonly type: "array"; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["i", "role", "basis", "confidence"]; readonly properties: { readonly i: { readonly type: "integer"; }; readonly role: { readonly type: "string"; readonly enum: ("feature" | "other_place" | "same_place_alternate" | "same_place_former" | "same_place_spelling" | "unknown")[]; }; readonly basis: { readonly type: "string"; readonly enum: ("context" | "form" | "known")[]; }; readonly confidence: { readonly type: "string"; readonly enum: readonly ["high", "medium", "low"]; }; }; }; }; }; }; /** * Renders the items of one request as the user message the model reads. */ export declare function renderNameRoleItems(items: readonly VariantNameItem[]): string; /** * Builds the Messages parameters of one request. */ export declare function nameRoleRequestParams(items: readonly VariantNameItem[], options: { model: string; effort: string; }): MessageBatchRequest["params"]; /** * Parses one response into a label per item index. * * @throws When the text fails to parse as the schema's object, an index is outside * the request or repeated, a value is outside its enumeration, or the response * labels a different number of items than the request held. */ export declare function parseNameRoleResponse(text: string, itemCount: number): VariantNameLabel[]; export {}; //# sourceMappingURL=prompt.d.ts.map