mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-09-13 10:11:25 +00:00
🐛 fix: Keep the system default when the upload provider is unresolved
An upload reports the agents endpoint when the agent's real provider cannot be resolved, as for ephemeral agents with no persisted record. Judging capability from that container downgraded PDF, audio, and video to text even where the actual provider delivers them natively. An unresolved provider now keeps the system default rather than being treated as incapable.
This commit is contained in:
parent
012499e7f4
commit
999dc26891
2 changed files with 15 additions and 1 deletions
|
|
@ -189,6 +189,15 @@ describe('resolveDefaultLLMDeliveryPath', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('keeps the system default when the provider is unresolved (agents container)', () => {
|
||||
expect(resolveDefaultLLMDeliveryPath('audio/mpeg', undefined, undefined, 'agents')).toBe(
|
||||
'provider',
|
||||
);
|
||||
expect(resolveDefaultLLMDeliveryPath('application/pdf', undefined, undefined, 'agents')).toBe(
|
||||
'provider',
|
||||
);
|
||||
});
|
||||
|
||||
it('should export SYSTEM_LLM_DELIVERY_DEFAULTS with correct shape', () => {
|
||||
expect(SYSTEM_LLM_DELIVERY_DEFAULTS.fallback).toBe('text');
|
||||
expect(SYSTEM_LLM_DELIVERY_DEFAULTS.overrides).toEqual({
|
||||
|
|
|
|||
|
|
@ -70,7 +70,12 @@ export function resolveDefaultLLMDeliveryPath(
|
|||
/** Only the system default is capability-gated: an explicit config above is the
|
||||
* admin's decision. A known endpoint that cannot encode documents or media would
|
||||
* otherwise accept the upload and hand the model nothing at all. */
|
||||
if (systemDefault === 'provider' && endpoint != null && !isProviderCapable(mimeType, endpoint)) {
|
||||
/** `agents` is a container, not a provider: it is what an upload reports when the
|
||||
* agent's real provider could not be resolved, as for ephemeral agents. Judging
|
||||
* capability from it would downgrade media the actual provider can deliver, so an
|
||||
* unresolved provider keeps the system default. */
|
||||
const providerKnown = endpoint != null && endpoint !== EModelEndpoint.agents;
|
||||
if (systemDefault === 'provider' && providerKnown && !isProviderCapable(mimeType, endpoint)) {
|
||||
return 'text';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue