feat: source citations with footnotes in the transcript (#21)
This commit was merged in pull request #21.
This commit is contained in:
@@ -84,12 +84,39 @@ export interface PendingAttachment extends Attachment {
|
||||
/** Base64 of the image, with no `data:` URL prefix. Ollama wants it bare. */
|
||||
base64: string;
|
||||
}
|
||||
/**
|
||||
* One numbered source, as a web tool found it.
|
||||
*
|
||||
* The number is the whole point: it is assigned once per turn, printed to the
|
||||
* model in the tool result, and rendered as the marker the reader clicks. The
|
||||
* model and the reader therefore agree on what `[3]` means without either of them
|
||||
* being asked to remember a URL.
|
||||
*/
|
||||
export interface Source {
|
||||
/** The number the model cites. One-based, and never reused for a different page. */
|
||||
index: number;
|
||||
/** Page title, or the URL when the page had none. */
|
||||
title: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
/** What a tool actually returned during a turn, kept for display and debugging. */
|
||||
export interface ToolCallRecord {
|
||||
name: string;
|
||||
arguments: Record<string, unknown>;
|
||||
result: string;
|
||||
isError: boolean;
|
||||
/**
|
||||
* The sources this call added to the turn, if it consulted any.
|
||||
*
|
||||
* Only what this call found, never the turn's running total: the whole list is
|
||||
* the flattening of a turn's records, so storing the total here would write
|
||||
* the same page once per later call.
|
||||
*
|
||||
* Absent on turns stored before sources were numbered, which is honest rather
|
||||
* than empty: those answers never cited a number, so there is nothing to draw.
|
||||
*/
|
||||
sources?: Source[];
|
||||
/**
|
||||
* Set when the call was refused because the turn had already made it twice.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user