import type { Complete, Report, Triage } from '../triage/index.js'; import { type DocSource } from './retrieve.js'; import type { Embedder } from './embed.js'; import type { VectorStore } from './vector-store.js'; export interface AnswerOptions { /** The model. Without one, questions get no answer, only the acknowledgement. */ complete?: Complete; /** Extra help docs, as plain text or Markdown, searched along with the README. */ helpDocs?: string; /** The GitHub repo whose README is the main source of answers. */ readme?: { repo: string; token?: string; fetch?: typeof fetch; }; /** * The README on disk, read before GitHub's: the product's own checkout, where the handler runs. By default the * README at the root of the enclosing git repo (or the working directory, when deployed without .git), used only * when that checkout's GitHub remote is `readme.repo`. A path reads that file; `false` reads none. */ readmePath?: string | false; /** Adds semantic search to keyword search. Without one, sections are found by keywords alone. */ embedder?: Embedder; /** The product the customer is asking about, so the answer speaks for it. See `productName`. */ product?: string; /** * The vector database the answer is retrieved from: the docs are kept in it and it returns the sections nearest the * question. Without one, sections are embedded and ranked in memory. */ vectorStore?: VectorStore; /** The source name the help docs are stored under in the vector database. Default `help-docs`. */ helpDocsSource?: string; } /** Sources only the support desk answers from: its saved replies are for its own customers' conversations. */ export declare const DESK_ONLY_SOURCES: string[]; /** * The product Blazzy speaks for: `product`, else BLAZE_PRODUCT_NAME, else the repo's name (`acme/shop` -> `shop`). * Undefined when none is known. It is configuration, but kept to one short line since it goes into prompts. */ export declare function productName(product?: string, repo?: string): string | undefined; /** * Who the model works for. Without it, a model with thin docs fills the gap from whatever product the excerpts or its * own training suggest, and customers of one product get answers about another. */ export declare const identity: (product?: string) => string; /** The most help docs a project can register. Only the sections that match a question go into the prompt. */ export declare const MAX_HELP_DOCS = 90000; /** * The docs to answer from, by source: the extra help docs (`help-docs`, or `helpDocsSource`), then the README * (`readme`: on disk, else from GitHub). Empty when there are none. */ export declare function loadSources(options: Pick): Promise; /** The docs to answer from as one text: the extra help docs, then the README. Empty when there are none. */ export declare function loadDocs(options: Pick): Promise; /** Said once per process: without embeddings there are no vectors, so there's no vector database to build. */ export declare function noEmbedderNotice(): void; /** * A handler's warm-up: called at the start of every request, it builds the vector database of `load()`'s docs in the * background on the first one, so the docs are embedded before the first question needs them. Never at import time * (a framework building the app imports its routes), and never blocking a request. A failed build is retried after a * minute; until then, search embeds on demand or falls back to keywords. */ export declare function vectorWarmer(load: () => Promise, embedder: Embedder | undefined, store: VectorStore | undefined, explain?: boolean): () => void; /** * An answer to a customer's question, from the sections of the project's README (and any extra help docs) * that match it (RAG: keyword search, plus semantic search when an embedder is given). * Undefined when the report isn't a question, nothing is configured, no section matches, the model finds no answer * in them, or the model fails; the customer then gets the usual acknowledgement and the question stays with a human. */ export declare function answerQuestion(report: Report, verdict: Triage, options: AnswerOptions): Promise; /** What the customer is told when the model is unavailable or its reply is unusable. */ export declare function fallbackReply(verdict: Pick): string; /** * The reply a customer gets when their message isn't a question the docs answer: a short acknowledgement that shows * it was understood. Never reveals the triage verdict. Falls back to a fixed reply per kind without a model. */ export declare function replyToCustomer(report: Report, verdict: Triage, options: { complete?: Complete; product?: string; }): Promise; //# sourceMappingURL=index.d.ts.map