UNPKG

@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;" />

18 lines (16 loc) 598 B
import "reflect-metadata"; import { randomId } from "@copilotkit/shared"; //#region src/graphql/resolvers/resolve-message-id.ts /** * Resolve the id to use for a streamed TextMessageOutput. * * Upstream events occasionally arrive with `messageId` missing, null, or an * empty string. We fall back to a freshly generated id in those cases so the * resulting output never surfaces a null id to the GraphQL client (#2118). */ function resolveMessageId(eventMessageId) { return eventMessageId || randomId(); } //#endregion export { resolveMessageId }; //# sourceMappingURL=resolve-message-id.mjs.map