import type { TChatMessage } from "../../types/index.js"; import type { OpenAIStreamAdapterOptions, OpenAIStreamAdapterResult, OpenAIStreamSource } from "./types/index.js"; import { OpenAIResponseLike } from "./types/openAiTypes.js"; export type { OpenAIStreamAdapterOptions, OpenAIStreamAdapterResult, OpenAIStreamAdapterStatus, OpenAIStreamSource, } from "./types/index.js"; /** * When the stream splits the reply into two consecutive assistant messages, the same tool call can * appear in both. Moves matching tool parts into the earlier segment and drops the duplicate from * the later one so the UI does not show orphaned repeats. * * @param messages - Chat messages (possibly with duplicate tool parts across adjacent assistants). * @returns A shallow-copied message list with orphan duplicates collapsed. */ export declare function collapseOrphanToolBetweenAssistantSegments(messages: TChatMessage[]): TChatMessage[]; export declare function useOpenAIResponsesAdapter(response: OpenAIResponseLike | null): TChatMessage[]; export declare function useOpenAIStreamAdapter(stream: OpenAIStreamSource | null, options?: OpenAIStreamAdapterOptions): OpenAIStreamAdapterResult;