Skip to content

[Bug]: native PDF file uploading is unavailable for some providers #13603

@EurFelux

Description

@EurFelux

Issue Checklist

  • I understand that issues are for reporting problems and requesting features, not for off-topic comments, and I will provide as much detail as possible to help resolve the issue.
  • I have checked the pinned issues and searched through the existing open issues, closed issues, and discussions and did not find a similar suggestion.
  • I have provided a short and descriptive title so that developers can quickly understand the issue when browsing the issue list, rather than vague titles like "A suggestion" or "Stuck."
  • The latest version of Cherry Studio does not include the feature I am suggesting.

Platform

macOS

Version

v1.8.0

Bug Description

Native PDF file upload works with some builtin providers (e.g., Google/Gemini) but fails on others (e.g., cherryin) even though the underlying model supports PDF input.

Root Cause

supportsPdfInput() in modelCapabilities.ts checks against an AI SDK provider ID whitelist:

'openai', 'azure-openai', 'anthropic', 'google', 'google-generative-ai', 'google-vertex', 'bedrock', 'amazon-bedrock'

The cherryin provider has type new-api, so getAiSdkProviderId() does not resolve to any of these whitelisted IDs. As a result, supportsPdfInput() returns false for cherryin, and the PDF falls back to text extraction instead of being sent natively.

Expected Behavior

PDF files should be sent natively (as file/document parts) for any provider whose underlying model API supports PDF input, including new-api type providers like cherryin that proxy to PDF-capable APIs.

Relevant Code

  • src/renderer/src/aiCore/prepareParams/modelCapabilities.tssupportsPdfInput() (whitelist check)
  • src/renderer/src/aiCore/provider/factory.tsgetAiSdkProviderId() (provider ID resolution)
  • src/renderer/src/aiCore/prepareParams/fileProcessor.ts:205 (PDF handling decision point)

Metadata

Metadata

Assignees

Labels

ModelsCategorizes an issue or PR as relevant to SIG LLMP2Medium priorityUI/UX

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions