🔄 refactor: Select OpenRouter LLM Class Dynamically by baseURL (#8898)

This commit is contained in:
Danny Avila 2025-08-06 19:26:40 -04:00 committed by GitHub
parent 4175a3ea19
commit 36c8947029
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -1,4 +1,5 @@
import { ProxyAgent } from 'undici';
import { Providers } from '@librechat/agents';
import { KnownEndpoints, removeNullishValues } from 'librechat-data-provider';
import type { BindToolsInput } from '@langchain/core/language_models/chat_models';
import type { AzureOpenAIInput } from '@langchain/openai';
@ -222,9 +223,13 @@ export function getOpenAIConfig(
});
}
return {
const result: t.LLMConfigResult = {
llmConfig,
configOptions,
tools,
};
if (useOpenRouter) {
result.provider = Providers.OPENROUTER;
}
return result;
}