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

1 lines 707 B
{"version":3,"file":"resolve-message-id.cjs","names":[],"sources":["../../../src/graphql/resolvers/resolve-message-id.ts"],"sourcesContent":["import { randomId } from \"@copilotkit/shared\";\n\n/**\n * Resolve the id to use for a streamed TextMessageOutput.\n *\n * Upstream events occasionally arrive with `messageId` missing, null, or an\n * empty string. We fall back to a freshly generated id in those cases so the\n * resulting output never surfaces a null id to the GraphQL client (#2118).\n */\nexport function resolveMessageId(\n eventMessageId: string | null | undefined,\n): string {\n return eventMessageId || randomId();\n}\n"],"mappings":";;;;;;;;;;;;AASA,SAAgB,iBACd,gBACQ;AACR,QAAO,oDAA4B"}