import { type Span } from '@opentelemetry/api'; import type { Message } from '../../../types/message/index.js'; import type { ChatCompletionResponse, LLMProvider } from '../../../types/provider/index.js'; import type { SessionEvent } from '../../../types/session/index.js'; import type { Logger } from '../../../utils/logger.js'; import type { EmitEvent } from '../events.js'; import type { RequestImageIdentity } from '../request-rich-content.js'; export interface StreamingTurnResult { response: ChatCompletionResponse; messageId: import('../../../types/ids/index.js').MessageId; /** Captured only for host review, at the provider-chain dispatch boundary. */ requestMessages?: readonly Message[]; } export declare function streamProviderTurn(provider: LLMProvider, params: import('../../../types/provider/index.js').ChatCompletionParams, emitEvent: EmitEvent, drainPending: () => Generator, turnId: import('../../../types/ids/index.js').TurnId, iteration: number, forceFinalize: boolean, log: Logger, parentSpan?: Span, /** * The id to announce this message under. * * Supplied by the loop so a turn that THROWS still leaves the caller * holding the id it announced. The return value never arrives on a * failure, so without this the one case where a failed step most wants * to point at the event stream — a stream that died after * `message_started`, having already emitted `message_completed` on the * way out — is precisely the case that could not. * * Optional, so a caller with no use for the id is unchanged. */ announceAs?: import('../../../types/ids/index.js').MessageId, imageRecovery?: { readonly onAccepted: (identity: RequestImageIdentity) => Promise; }, captureRequest?: boolean, /** The session the turn belongs to, named on the chat span as `gen_ai.conversation.id`. */ sessionId?: import('../../../types/ids/index.js').SessionId): AsyncGenerator; //# sourceMappingURL=stream-turn.d.ts.map