🐞 fix: Add Null Checks for BaseURL in Agent Config (#5908)

This commit is contained in:
Danny Avila 2025-02-16 10:52:29 -05:00 committed by GitHub
parent 350e72dede
commit 93dd365fda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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(