import type { CodaliGatewayClassifierOutput, CodaliGatewayRequest } from "./CodaliGatewayTypes.js"; /** * Whether an answer must come from retrieved evidence, or may come from the * model itself. * * Codali was built for questions about things it cannot know — a tenant's Jira, * this week's commits, a repository it has never seen — so every answer was * required to rest on a tool result. Asked to compose a short poem, it searched * the repository, found nothing, and reported that the information could not be * verified. Asked a settled geography fact, it retrieved the answer and still * hedged. * * Both modes are necessary and they are not interchangeable: * * - `grounded` — the answer must be traceable to a source. Anything about the * user's data, this workspace, or the current state of the world. * - `open` — the model answers from its own knowledge. Generation and ordinary * reasoning, where there is no source to cite and demanding one produces a * refusal instead of an answer. * * The default is `grounded`. A wrong `open` invents facts; a wrong `grounded` * only wastes a search, so the failure modes are not symmetric and the * uncertain case must fall to `grounded`. */ export type CodaliGroundingMode = "grounded" | "open"; export interface GroundingDecision { mode: CodaliGroundingMode; reason: string; } export interface GroundingDecisionInput { query: string; classifier: Pick; } export declare const decideGroundingMode: (input: GroundingDecisionInput) => GroundingDecision; /** * Whether looking something up could settle the ambiguity the classifier found. * * The classifier decides `needsClarification` before a single tool has run, and * it is the smallest model in the run. On one host's production measurement * that judgement returned a question instead of an answer on five of fifteen * queries — "which project management system hosts the X tasks?", "could you * clarify which person you are referring to?" — while other queries minutes * later retrieved exactly that data without difficulty. The information was * there; nothing had gone looking for it. * * So a run that can retrieve does. The clarifying question is not discarded: it * is carried to the synthesizer, which has the evidence in front of it and can * tell a genuinely ambiguous referent from one the data resolves. A run with * nothing to search — no tenant, or no tools beyond the code index — still * stops and asks, because for it the question really is unanswerable. */ export declare const retrievalCanResolveAmbiguity: (request: Pick) => boolean; /** * Whether the request is about data the user owns, and so whether the * connectors that reach their accounts should be offered at all. * * Deliberately generous: a wrong "yes" offers a tool the planner may ignore, * while a wrong "no" hides the only tool that could have answered. So the * classifier's own judgement is honoured first, and either naming the system or * claiming the data is enough. */ export declare const requestTouchesOwnData: (query: string, classifier: Pick) => boolean; //# sourceMappingURL=GroundingMode.d.ts.map