{"record":{"id":"864a15548f1b0ef0","repo":"vercel/ai","slug":"deepseek-imagedetail-cannot-be-combined-with-fi","errorCode":null,"errorMessage":"DeepSeek `imageDetail` cannot be combined with `fileData`.","messagePattern":"DeepSeek `imageDetail` cannot be combined with `fileData`\\.","errorType":"exception","errorClass":"InvalidPromptError","httpStatus":null,"severity":"error","filePath":"packages/deepseek/src/chat/convert-to-deepseek-chat-messages.ts","lineNumber":218,"sourceCode":"                userContent.push({\n                  type: 'image_url',\n                  image_url: {\n                    url,\n                    ...(filePartOptions?.imageDetail != null && {\n                      detail: filePartOptions.imageDetail,\n                    }),\n                  },\n                });\n              } else {\n                const dataUrl = `data:${\n                  resolvedMediaType === 'image/jpg'\n                    ? 'image/jpeg'\n                    : resolvedMediaType\n                };base64,${convertToBase64(part.data.data)}`;\n\n                if (filePartOptions?.fileData === true) {\n                  if (filePartOptions.imageDetail != null) {\n                    throw new InvalidPromptError({\n                      prompt,\n                      message:\n                        'DeepSeek `imageDetail` cannot be combined with `fileData`.',\n                    });\n                  }\n\n                  userContent.push({\n                    type: 'file',\n                    file_data: dataUrl,\n                    ...(part.filename != null && { filename: part.filename }),\n                  });\n                } else {\n                  userContent.push({\n                    type: 'image_url',\n                    image_url: {\n                      url: dataUrl,\n                      ...(filePartOptions?.imageDetail != null && {\n                        detail: filePartOptions.imageDetail,","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/deepseek/src/chat/convert-to-deepseek-chat-messages.ts#L200-L236","documentation":"DeepSeek's imageDetail provider option is incompatible with fileData mode. The SDK throws InvalidPromptError when both deepseek.fileData === true and deepseek.imageDetail are set on the same image part.","triggerScenarios":"Setting both options on one image part: providerOptions: { deepseek: { fileData: true, imageDetail: 'high' } }.","commonSituations":"Spreading a shared providerOptions object that includes imageDetail into parts that also enable fileData; migrating from URL-based parts (where imageDetail is meaningful) to fileData parts without removing imageDetail.","solutions":["Remove imageDetail from parts that set fileData: true","Keep imageDetail only on inline-data/URL parts that do not use fileData"],"exampleFix":"// before\nproviderOptions: { deepseek: { fileData: true, imageDetail: 'high' } }\n// after\nproviderOptions: { deepseek: { fileData: true } }","handlingStrategy":"validation","validationCode":"function assertNoImageDetailWithFileData(opts) {\n  if (opts?.deepseek?.fileData === true && opts?.deepseek?.imageDetail != null) {\n    throw new Error('imageDetail cannot be combined with fileData');\n  }\n}","typeGuard":null,"tryCatchPattern":"try { ... } catch (e) { if (InvalidPromptError.isInstance(e) && /imageDetail/.test(e.message)) { /* strip imageDetail and retry */ } throw e; }","preventionTips":["Pick one mode per image part: fileData OR imageDetail","Strip conflicting keys when copying provider options between parts","Add an options schema/lint check in your prompt builder"],"tags":["deepseek","image","filedata","imagedetail","invalid-combination"],"backgroundTag":"invalid-provider-options","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}