import { GenerativeAIJobType } from '../../GenerativeAIJobType'; import { IGenerativeAIJobResult } from '../../job/GenerativeAIJobResult'; import { ISearchResult } from '../../search'; import { PromptTypeText, PromptTypeVector } from './result'; /** * The AI prompt result Interface * Represents the result of an AI prompt. * @category AI */ export interface IGenerativeAIPromptResult extends IGenerativeAIJobResult { /** * The prompt AI job type. */ type: GenerativeAIJobType.Prompt | GenerativeAIJobType.Inference | GenerativeAIJobType.Embed; /** * The output of the AI job. */ output?: PromptTypeText | PromptTypeVector; /** * The relevant context used by the AI job. */ context?: ISearchResult[]; /** * The internal context used by the AI job. */ internalContext?: { [key: string]: string; }; /** * The file generated by the AI job. */ resultFile?: string; /** * The tokens used by the AI job. */ inputTokens?: number; /** * The tokens generated by the AI job. */ outputTokens?: number; /** * The tokens used by the AI job, bucketed by type for billing. `base` holds * tokens billed at the model's list price; other buckets (cacheRead, * cacheWrite5m, cacheWrite1h, cached, audio, image, …) are converted to * base-token equivalents at billing time via the model's tokenRates. * Optional: connectors without per-type usage data keep reporting only the * flat inputTokens/outputTokens counts. */ tokenBuckets?: { input?: Record; output?: Record; }; }