🧪 fix(ci): update failing initializeClient tests with new expected values (#1982)

* fix(ci): update failing tests with new expected values from `getUserKey`

* refactor: safer optional chaining, and ensure apiKey is defined
This commit is contained in:
Danny Avila 2024-03-05 14:33:45 -05:00 committed by GitHub
parent 2ea6e8c18a
commit 7a6a41a72e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 18 deletions

View file

@ -50,8 +50,8 @@ const initializeClient = async ({ req, res, endpointOption }) => {
}
}
let apiKey = userProvidesKey ? userValues.apiKey : credentials[endpoint];
let baseURL = userProvidesURL ? userValues.baseURL : baseURLOptions[endpoint];
let apiKey = userProvidesKey ? userValues?.apiKey : credentials[endpoint];
let baseURL = userProvidesURL ? userValues?.baseURL : baseURLOptions[endpoint];
const clientOptions = {
debug: isEnabled(DEBUG_OPENAI),