{"record":{"id":"aa2401397b75118e","repo":"vercel/ai","slug":"unsupported-role-exhaustivecheck-aa2401","errorCode":null,"errorMessage":"Unsupported role: ${_exhaustiveCheck}","messagePattern":"Unsupported role: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cohere/src/convert-to-cohere-chat-prompt.ts","lineNumber":194,"sourceCode":"                case 'json':\n                case 'error-json':\n                  contentValue = JSON.stringify(output.value);\n                  break;\n              }\n\n              return {\n                role: 'tool' as const,\n                content: contentValue,\n                tool_call_id: toolResult.toolCallId,\n              };\n            }),\n        );\n\n        break;\n      }\n      default: {\n        const _exhaustiveCheck: never = role;\n        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n\n  return { messages, documents, warnings };\n}\n\nfunction buildImageUrl({ part }: { part: LanguageModelV4FilePart }): string {\n  switch (part.data.type) {\n    case 'url': {\n      return part.data.url.toString();\n    }\n    case 'data': {\n      return `data:${resolveFullMediaType({ part })};base64,${convertToBase64(part.data.data)}`;\n    }\n    case 'reference': {\n      throw new UnsupportedFunctionalityError({\n        functionality: 'image file parts with provider references',","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/cohere/src/convert-to-cohere-chat-prompt.ts#L176-L212","documentation":"Error \"Unsupported role: ${_exhaustiveCheck}\" thrown in vercel/ai.","triggerScenarios":"Thrown at packages/cohere/src/convert-to-cohere-chat-prompt.ts:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}