import { APIResource } from "../core/resource.js"; import { APIPromise } from "../core/api-promise.js"; import { RequestOptions } from "../internal/request-options.js"; export declare class Autosuggest extends APIResource { /** * Suggest original Auto FAQ questions using per-token fuzzy matching and prefix * matching when the final token is ordinary. Identifier-like tokens are not fuzzy * or prefix matched. Results below 30% of the best relevance score are omitted * when that score is positive. */ suggest(params: AutosuggestSuggestParams, options?: RequestOptions): APIPromise; } export type AutosuggestSuggestResponse = Array | Array; export declare namespace AutosuggestSuggestResponse { /** * Verbatim FAQ question with the matched regions to highlight. * * Offsets count Unicode code points, not UTF-16 code units. JavaScript/TypeScript * clients can select a span with * `Array.from(suggestion).slice(start, end).join('')`. For example, offsets [2, 8) * in "𠀀 Docker" select "Docker". */ interface UnionMember1 { /** * Matched regions in the suggestion. */ highlight_spans: Array; /** * Original FAQ question text, preserved verbatim for cache lookup. */ suggestion: string; } namespace UnionMember1 { /** * Matched region in a verbatim FAQ question, measured in Unicode code points. */ interface HighlightSpan { /** * Zero-based, exclusive end offset in Unicode code points in the original FAQ * question. */ end: number; /** * Zero-based, inclusive start offset in Unicode code points in the original FAQ * question. */ start: number; } } } export interface AutosuggestSuggestParams { /** * Query param */ chatbot_id: string; /** * Query param: Query must be between 3 and 30 characters */ query: string; /** * Query param: Return suggestion objects with highlight spans when true. */ highlight?: boolean; /** * Query param */ size?: number; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace Autosuggest { export { type AutosuggestSuggestResponse as AutosuggestSuggestResponse, type AutosuggestSuggestParams as AutosuggestSuggestParams, }; } //# sourceMappingURL=autosuggest.d.ts.map