/** @jsx createElement */ import type { ChatRecord, ChatRecordsStore } from '../../../lib/utils'; import type { Renderer } from '../../../types'; /** * Shared presentational component for grounded comparison tables. Used by both * the `algolia_display_results` markdownTable path (`ComparisonTableTool`) and * the builtin `algolia_compare_products` tool (`CompareProductsTool`). * * This is the "render the table from product IDs, not model text" fix from the * agentic-evals comparison study: the agent emits ONLY the product objectIDs * and the attribute *keys* to compare — never the values. Every cell is * hydrated from the chat records store (the records the search tools actually * fetched), so the model physically cannot type (and therefore cannot * hallucinate) a price or spec. */ export type ComparisonTableTranslations = { /** Text shown in a cell when the catalog record has no value for it. */ missingValueLabel: string; /** Header for the first (product) column when no label is provided. */ productColumnLabel: string; }; export declare const defaultComparisonTableTranslations: ComparisonTableTranslations; export type ComparisonTableCellProps = { /** Hydrated catalog record for this row (undefined if the record is missing). */ hit?: ChatRecord; /** Attribute key to display (undefined for the product/name column). */ attribute?: string; /** Resolved, catalog-sourced value (undefined if missing). */ value?: unknown; isHeader: boolean; }; /** * Everything the grounded table needs to render. Note there is deliberately no * field for attribute VALUES: they can only come from `records`. */ export type GroundedComparisonTableProps = { /** Optional model-authored lead-in (prose, rendered above the table). */ intro?: string; /** Products to compare, one row each, referenced by objectID only. */ objectIDs: string[]; /** Attribute keys to read off each record (also used as default headers). */ attributes: string[]; /** Optional display labels: [productColumn, ...attributeColumns]. */ columns?: string[]; /** The records the chat's tools have fetched, keyed by `objectID`. */ records?: Pick; translations: ComparisonTableTranslations; }; export declare function createGroundedComparisonTableComponent({ createElement, Fragment, }: Renderer): (props: GroundedComparisonTableProps) => JSX.Element;