When i log only configuration i have this:
Configuration {
apiKey: 'API key',
organization: undefined,
username: undefined,
password: undefined,
accessToken: undefined,
basePath: undefined,
baseOptions: {
headers: {
'User-Agent': 'OpenAI/NodeJS/3.1.0',
Authorization: 'auth'
}
},
formDataCtor: [Function: FormData] {
LINE_BREAK: '\r\n',
DEFAULT_CONTENT_TYPE: 'application/octet-stream'
}
}
but when i put all this code it
gets the same problem:
OpenAIApi {
basePath: 'https://api.openai.com/v1',
axios: <ref *1> [Function: wrap] {
request: [Function: wrap],
getUri: [Function: wrap],
delete: [Function: wrap],
get: [Function: wrap],
head: [Function: wrap],
options: [Function: wrap],
post: [Function: wrap],
put: [Function: wrap],
patch: [Function: wrap],
defaults: {
transitional: [Object],
adapter: [Function: httpAdapter],
transformRequest: [Array],
transformResponse: [Array],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: [Function: validateStatus],
headers: [Object]
},
interceptors: { request: [InterceptorManager], response: [InterceptorManager] },
create: [Function: create],
Axios: [Function: Axios],
Cancel: [Function: Cancel],
CancelToken: [Function: CancelToken] { source: [Function: source] },
isCancel: [Function: isCancel],
VERSION: '0.26.1',
all: [Function: all],
spread: [Function: spread],
isAxiosError: [Function: isAxiosError],
default: [Circular *1]
},
}
}
Error: Request failed with status code 400
at createError (C:\Users\LORC1\OneDrive\Pulpit\Nowy folder\node_modules\openai\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\LORC1\OneDrive\Pulpit\Nowy folder\node_modules\openai\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\LORC1\OneDrive\Pulpit\Nowy folder\node_modules\openai\node_modules\axios\lib\adapters\http.js:322:11)
at IncomingMessage.emit (node:events:538:35)
at endReadableNT (node:internal/streams/readable:1342:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)