diff --git a/api/app/clients/BaseClient.js b/api/app/clients/BaseClient.js index 149d331df1..c0d9169b51 100644 --- a/api/app/clients/BaseClient.js +++ b/api/app/clients/BaseClient.js @@ -1213,8 +1213,8 @@ class BaseClient { this.options.req, attachments, { - provider: this.options.agent?.provider, - endpoint: this.options.agent?.endpoint, + provider: this.options.agent?.provider ?? this.options.endpoint, + endpoint: this.options.agent?.endpoint ?? this.options.endpoint, useResponsesApi: this.options.agent?.model_parameters?.useResponsesApi, }, getStrategyFunctions, @@ -1231,8 +1231,8 @@ class BaseClient { this.options.req, attachments, { - provider: this.options.agent?.provider, - endpoint: this.options.agent?.endpoint, + provider: this.options.agent?.provider ?? this.options.endpoint, + endpoint: this.options.agent?.endpoint ?? this.options.endpoint, }, getStrategyFunctions, ); @@ -1246,8 +1246,8 @@ class BaseClient { this.options.req, attachments, { - provider: this.options.agent?.provider, - endpoint: this.options.agent?.endpoint, + provider: this.options.agent?.provider ?? this.options.endpoint, + endpoint: this.options.agent?.endpoint ?? this.options.endpoint, }, getStrategyFunctions, );