import * as z from "zod/v4"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { InternChatChoice } from "./internchatchoice.js"; import { InternChatStreamError } from "./internchatstreamerror.js"; import { InternChatUsage } from "./internchatusage.js"; export declare const InternChatCompletionChunkObject: { readonly ChatCompletionChunk: "chat.completion.chunk"; }; export type InternChatCompletionChunkObject = ClosedEnum; /** * One `data:` line of the stream. A run streams a role chunk, content and reasoning chunks, then a finish chunk: `stop`, `tool_calls` (the run is paused for input) or `error` (with an `error` object). A final chunk with empty `choices` follows in every case, carrying `session_id` and `usage` (`null` unless the daemon reported usage, and always `null` after `tool_calls`). Every stream ends with `[DONE]`. */ export type InternChatCompletionChunk = { /** * One choice on content, tool-call and error chunks. Empty on the final chunk that carries `session_id`. */ choices: Array; created: number; /** * A failure after the response headers were sent. The chunk that carries it has `finish_reason: "error"`, then the final empty-`choices` chunk and `[DONE]` follow. Reasons here are `attachment_failed`, `busy`, `client_closed_request`, `interaction_not_pending`, `interaction_unknown`, `intern_unreachable`, `run_ended`, `stream_severed`, `timeout` or `turn_failed`. `run_ended` reports an ending the intern confirmed, such as a cancellation or a deadline, while `stream_severed` reports a connection lost without that confirmation. */ error?: InternChatStreamError | undefined; /** * The completion id, constant for the whole response. */ id: string; /** * The runtime's identifier for the model the intern is running, as the intern reports it. Each chunk carries the model from the event behind it: `openrouter/intern` on chunks emitted before the intern has reported one and on chunks the API emits itself (timeout, run-ended and severed-stream errors and their final usage chunk), even after an earlier chunk named a model. It can change within a stream. It is not an OpenRouter model slug, and the request `model` is never used. */ model: string; object: InternChatCompletionChunkObject; /** * On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction. Session ids are client-visible and scoped to the intern's own daemon. */ sessionId?: string | null | undefined; /** * Token usage for the run as the daemon reported it, on the final chunk before `[DONE]`. `null` when the daemon reported none, and always `null` after `tool_calls` because the turn is not over. */ usage?: InternChatUsage | null | undefined; }; /** @internal */ export declare const InternChatCompletionChunkObject$inboundSchema: z.ZodEnum; /** @internal */ export declare const InternChatCompletionChunk$inboundSchema: z.ZodType; export declare function internChatCompletionChunkFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=internchatcompletionchunk.d.ts.map