import type { AdvancedAutoqueryEvent, AnswerEvent } from '@orama/oramacore-events-parser'; import type { AnyObject, Nullable, SearchParams, SearchResult } from './index.js'; import type { Client, ClientRequestInit } from './common.js'; export type AnswerSessionConfig = { collectionID: string; initialMessages?: Message[]; events?: CreateAISessionConfig['events']; sessionID?: string; LLMConfig?: CreateAISessionConfig['LLMConfig']; common: Client; }; export type AnswerConfig = { query: string; interactionID?: string; visitorID?: string; sessionID?: string; messages?: Message[]; related?: Nullable; datasourceIDs?: string[]; min_similarity?: number; max_documents?: number; ragat_notation?: string; }; export type Message = { role: Role; content: string; }; export type RelatedQuestionsConfig = { enabled?: Nullable; size?: Nullable; format?: Nullable<'question' | 'query'>; }; export type Role = 'system' | 'assistant' | 'user'; export type AnswerStep = AnswerEvent['type']; export type NLPQueryStep = AdvancedAutoqueryEvent['type']; export type Interaction = { id: string; query: string; optimizedQuery: Nullable; response: string; sources: Nullable; loading: boolean; error: boolean; errorMessage: Nullable; aborted: boolean; related: Nullable; currentStep: Nullable; currentStepVerbose: Nullable; selectedLLM: Nullable; advancedAutoquery: Nullable<{ optimizedQueries?: Nullable; selectedProperties?: Nullable; selectedPropertiesWithValues?: { [key: string]: { collection: string; properties: string[]; }; }; queriesAndProperties?: Nullable<{ query: string; properties: AnyObject; filter_properties: AnyObject; }[]>; trackedQueries?: Nullable<{ index: number; original_query: string; generated_query_text: string; search_params: SearchParams; }[]>; searchResults?: Nullable<{ original_query: string; generated_query: string; search_params: SearchParams; results: SearchResult[]; query_index: number; }[]>; results?: Nullable<{ original_query: string; generated_query: string; search_params: SearchParams; results: SearchResult[]; query_index: number; }[]>; }>; }; export type LLMConfig = { provider: 'openai' | 'fireworks' | 'together' | 'google'; model: string; }; export type CreateAISessionConfig = { LLMConfig?: LLMConfig; initialMessages?: Message[]; events?: { onStateChange?: (state: Interaction[]) => void; onEnd?: (state: Interaction[]) => void; onIncomingEvent?: (event: any) => void; }; }; export declare class OramaCoreStream { private collectionID; private oramaInterface; private abortController?; private events?; private LLMConfig?; private sessionID?; private lastInteractionParams?; messages: Message[]; state: Interaction[]; constructor(config: AnswerSessionConfig); answer(data: AnswerConfig, init?: ClientRequestInit): Promise; answerStream(data: AnswerConfig, init?: ClientRequestInit): AsyncGenerator; regenerateLast({ stream }?: { stream?: boolean | undefined; }, init?: ClientRequestInit): string | Promise | AsyncGenerator; abort(): void; clearSession(): void; private _pushState; private _enrichConfig; } //# sourceMappingURL=stream-manager.d.ts.map