mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00
🐞 fix: Add Null Checks for BaseURL in Agent Config (#5908)
This commit is contained in:
parent
350e72dede
commit
93dd365fda
2 changed files with 2 additions and 2 deletions
|
@ -45,7 +45,7 @@ async function createRun({
|
|||
|
||||
/** @type {'reasoning_content' | 'reasoning'} */
|
||||
let reasoningKey;
|
||||
if (llmConfig.configuration?.baseURL.includes(KnownEndpoints.openrouter)) {
|
||||
if (llmConfig.configuration?.baseURL?.includes(KnownEndpoints.openrouter)) {
|
||||
reasoningKey = 'reasoning';
|
||||
}
|
||||
if (/o1(?!-(?:mini|preview)).*$/.test(llmConfig.model)) {
|
||||
|
|
|
@ -58,7 +58,7 @@ function getLLMConfig(apiKey, options = {}) {
|
|||
|
||||
/** @type {OpenAIClientOptions['configuration']} */
|
||||
const configOptions = {};
|
||||
if (useOpenRouter || reverseProxyUrl.includes(KnownEndpoints.openrouter)) {
|
||||
if (useOpenRouter || (reverseProxyUrl && reverseProxyUrl.includes(KnownEndpoints.openrouter))) {
|
||||
llmConfig.include_reasoning = true;
|
||||
configOptions.baseURL = reverseProxyUrl;
|
||||
configOptions.defaultHeaders = Object.assign(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue