@copilotkit/runtime
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
22 lines (21 loc) • 981 B
text/typescript
import "reflect-metadata";
import { BaseEvent, Interrupt } from "@ag-ui/client";
//#region src/agent/converters/aisdk.d.ts
/**
* Converts an AI SDK `fullStream` into AG-UI `BaseEvent` objects.
*
* This is a pure converter — it does NOT emit lifecycle events
* (RUN_STARTED / RUN_FINISHED / RUN_ERROR). The caller (Agent class)
* is responsible for those.
*
* Terminal stream events (finish, error, abort) cause the generator to
* return so the caller can handle lifecycle appropriately.
*
* `pendingInterrupts`, when provided, is filled with one AG-UI Interrupt per
* AI SDK `tool-approval-request` part (a tool declared `needsApproval: true`).
* The caller turns a non-empty array into a RUN_FINISHED `outcome:interrupt`.
*/
declare function convertAISDKStream(fullStream: AsyncIterable<unknown>, abortSignal: AbortSignal, pendingInterrupts?: Interrupt[]): AsyncGenerator<BaseEvent>;
//#endregion
export { convertAISDKStream };
//# sourceMappingURL=aisdk.d.mts.map