Giter VIP home page Giter VIP logo

Comments (16)

ponlponl123 avatar ponlponl123 commented on July 18, 2024

This error message appears to be related to the speaker package in a Node.js project. There are a few different warnings and errors that are shown in the output:

  • Two npm WARN messages are displayed, indicating that two packages (request and querystring) are deprecated and may cause issues in the future. It is recommended to update to the latest versions of these packages, or use alternative packages if possible.

  • The npm ERR! code 1 message indicates that there was an error during the installation or build process of the speaker package.

  • The subsequent output shows the error message that was generated during the build process. It appears to be related to the node-gyp package, which is used for building native Node.js add-ons. The error message suggests that node-gyp was unable to find a compatible version of Visual Studio to use for building the speaker package.

To resolve this issue, there are a few potential steps that could be taken:

  • Update the request and querystring packages to their latest versions or use alternative packages to avoid the deprecation warnings.

  • Ensure that a compatible version of Visual Studio is installed on the system, and that it is properly configured for use with node-gyp. The error message indicates that Visual Studio 2017 or newer is required, and that the "Desktop development with C++" workload needs to be installed. The node-gyp documentation provides more detailed instructions for configuring Visual Studio on Windows: https://github.com/nodejs/node-gyp#on-windows.

  • If the speaker package is not necessary for the project, it could be removed or replaced with an alternative package that does not require native add-ons to be built.

I think this will solve your problem!

from -prototype-aivtuber.

Lwnlcks avatar Lwnlcks commented on July 18, 2024

The above problem has been resolved.
But there's another problem.

PS C:\AI_Vtuber\TTS> node main.js
listening on localhost:8000
[20:47] info: Connecting to irc-ws.chat.twitch.tv on port 443..
[20:47] info: Sending authentication to server..
[20:47] error: Login unsuccessful
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Login unsuccessful".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

#3 I've referred to it, but the error hasn't been resolved.

Aren't you supposed to input it as below?

main.js
------
var twitch_username = '(twitch Username(Twitch ID))';
var twitch_token = '(access_token)';
var twitch_channel = [ '(twitch Display Name)' ];

from -prototype-aivtuber.

Renolo avatar Renolo commented on July 18, 2024

when entering this, an error appears

from -prototype-aivtuber.

ponlponl123 avatar ponlponl123 commented on July 18, 2024

You should make sure that all of these:

  • var twitch_username = 'YOUR_TWITCH_USERNAME';
  • var twitch_token = 'YOUR_TWITCH_TOKEN';
  • var twitch_channel = [ 'YOUR_TWITCH_CHANNEL' ];
  • var ffmpeg_path = 'YOUR_FFMPEG_PATH';
  • var openai_organization = 'YOUR_ORGANIZATION_ID';
  • var openai_apiKey = 'YOUR_API_KEY';
  • var aws_region = 'YOUR_AWS_REGION';
  • var aws_accessKeyId = 'YOUR_AWS_ACCESS_KEY_ID';
  • var aws_secretAccessKey = 'YOUR_AWS_SECRET_ACCESS_KEY';

has been entered correctly before using node main.js

I think this will solve your problem!

from -prototype-aivtuber.

Renolo avatar Renolo commented on July 18, 2024

is aws_secretAccessKey required?

from -prototype-aivtuber.

Renolo avatar Renolo commented on July 18, 2024

and do I have to enter anything in these lines?

from -prototype-aivtuber.

Renolo avatar Renolo commented on July 18, 2024

It's just that when I entered all these values in these lines I got an error

from -prototype-aivtuber.

ponlponl123 avatar ponlponl123 commented on July 18, 2024

If you want TTS or Text-To-Speech from AWS, that's a must. You can find those keys in the AWS Console.

Go to the AWS Console at https://console.aws.amazon.com/ and get Access keys from Security credentials
AWS Access keys

from -prototype-aivtuber.

ponlponl123 avatar ponlponl123 commented on July 18, 2024

It seems that the login was unsuccessful when trying to connect to the Twitch chat. This error message indicates that there was an unhandled promise rejection in your Node.js application.

To solve this error, you should add a catch block to handle the rejected promise. Here's an example:

try {
  // code that may throw an error or reject a promise
} catch (error) {
  // handle the error
}

Alternatively, you could also use the catch method on the promise to handle the rejection:

promise.catch((error) => {
  // handle the error
});

In your case, you should check your authentication credentials and make sure that they are correct. You can also try logging in manually to Twitch chat to see if there are any issues with your account. Additionally, you can add a catch block to your code to handle the rejection:

const client = new tmi.Client({
    options: { debug: true },
    connection: { reconnect: true },
    identity: {
        username: twitch_username,
        password: twitch_token
    },
    channels: twitch_channel
});
client.connect().catch((error) => {
    console.error(error);
});

This should help you get started in identifying and resolving the issue.

from -prototype-aivtuber.

Lwnlcks avatar Lwnlcks commented on July 18, 2024

It's settled. Thank you.

from -prototype-aivtuber.

ponlponl123 avatar ponlponl123 commented on July 18, 2024

Thanks for the feedback. I will make it even better in the future! 🙂

from -prototype-aivtuber.

Lwnlcks avatar Lwnlcks commented on July 18, 2024

How do I resolve the error that occurs when I type in the twitch chat? (I just said it was fixed, but there is another bug...)

.....
C:\AI_Vtuber\TTS\main.js:121
                Text: '<speak><prosody pitch="high">'+message+".................... "+gptResponse.data.choices[0].text+'</prosody></speak>',
                                                                                                  ^

TypeError: Cannot read properties of undefined (reading 'data')
    at client.<anonymous> (C:\AI_Vtuber\TTS\main.js:121:99)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

from -prototype-aivtuber.

ponlponl123 avatar ponlponl123 commented on July 18, 2024

The error message indicates that the program attempted to read a property called "data" from an undefined object. This may be because the object is not initialized or incorrectly initialized.

to fix this problem You should especially check the code on line 121 of the "main.js" file. You should check if the variable "gptResponse" was properly initialized. and was not defined while the code attempted to read the "data" property.

If the problem persists You may want to consider adding debugging statements to your code to help you trace the root cause of the problem. For example, you could add a console.log statement to print the value of "gptResponse" before the line that caused the error. to see if it is initialized correctly.

I'm sorry for not being able to give you a definite answer to fix it, if I'm doing everything right. I will do my best to solve your problem!

from -prototype-aivtuber.

Lwnlcks avatar Lwnlcks commented on July 18, 2024

openai api 429
similar case

I guess it's the openai api problem.
Thank you for your answer.

error full log
Error: Request failed with status code 429
    at createError (C:\AI_Vtuber\TTS\node_modules\axios\lib\core\createError.js:16:15)
    at settle (C:\AI_Vtuber\TTS\node_modules\axios\lib\core\settle.js:17:12)
    at IncomingMessage.handleStreamEnd (C:\AI_Vtuber\TTS\node_modules\axios\lib\adapters\http.js:322:11)
    at IncomingMessage.emit (node:events:525:35)
    at IncomingMessage.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'User-Agent': 'OpenAI/NodeJS/3.1.0',
      Authorization: 'Bearer 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',
      'OpenAI-Organization': 'org-EktG11PrLUBCnWbAtLAR6VTV',
      'Content-Length': 114
    },
    method: 'post',
    data: '{"model":"text-curie-001","prompt":"why?","temperature":0.9,"max_tokens":100,"stop":["ChatGPT:","Adrian Twarog:"]}',
    url: 'https://api.openai.com/v1/completions'
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: null,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'api.openai.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'api.openai.com',
      _readableState: [ReadableState],
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular *1],
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 82,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: true,
      [Symbol(kSetKeepAliveInitialDelay)]: 60,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object],
      [Symbol(RequestTimeout)]: undefined
    },
    _header: 'POST /v1/completions HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: application/json\r\n' +
      'User-Agent: OpenAI/NodeJS/3.1.0\r\n' +
      'Authorization: Bearer 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\r\n' +
      'OpenAI-Organization: org-EktG11PrLUBCnWbAtLAR6VTV\r\n' +
      'Content-Length: 114\r\n' +
      'Host: api.openai.com\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object: null prototype],
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype],
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/v1/completions',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      socket: [TLSSocket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [Array],
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 429,
      statusMessage: 'Too Many Requests',
      client: [TLSSocket],
      _consuming: false,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'https://api.openai.com/v1/completions',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 14,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'api.openai.com',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 114,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'https://api.openai.com/v1/completions',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'user-agent': [Array],
      authorization: [Array],
      'openai-organization': [Array],
      'content-length': [Array],
      host: [Array]
    },
    [Symbol(kUniqueHeaders)]: null
  },
  response: {
    status: 429,
    statusText: 'Too Many Requests',
    headers: {
      date: 'Wed, 08 Mar 2023 13:18:15 GMT',
      'content-type': 'application/json; charset=utf-8',
      'content-length': '206',
      connection: 'close',
      vary: 'Origin',
      'x-request-id': '24af4fc67ab6f4268b2918154132e99f',
      'strict-transport-security': 'max-age=15724800; includeSubDomains' 
    },
    config: {
      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],
      method: 'post',
      data: '{"model":"text-curie-001","prompt":"why?","temperature":0.9,"max_tokens":100,"stop":["ChatGPT:","Adrian Twarog:"]}',
      url: 'https://api.openai.com/v1/completions'
    },
    request: <ref *1> ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: null,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'POST /v1/completions HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: application/json\r\n' +
        'User-Agent: OpenAI/NodeJS/3.1.0\r\n' +
        'Authorization: Bearer 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\r\n' +
        'OpenAI-Organization: org-EktG11PrLUBCnWbAtLAR6VTV\r\n' +        
        'Content-Length: 114\r\n' +
        'Host: api.openai.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/v1/completions',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'api.openai.com',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
    data: { error: [Object] }
  },
  isAxiosError: true,
  toJSON: [Function: toJSON]
}
C:\AI_Vtuber\TTS\main.js:121
                Text: '<speak><prosody pitch="high">'+message+".................... "+gptResponse.data.choices[0].text+'</prosody></speak>',      

                         ^

TypeError: Cannot read properties of undefined (reading 'data')
    at client.<anonymous> (C:\AI_Vtuber\TTS\main.js:121:99)
    at processTicksAnnode main.js        ternal/process/task_queues:96:5)

from -prototype-aivtuber.

Lwnlcks avatar Lwnlcks commented on July 18, 2024

openai api 429
similar case

I guess it's the openai api problem.
Thank you for your answer.

error full log
Error: Request failed with status code 429
    at createError (C:\AI_Vtuber\TTS\node_modules\axios\lib\core\createError.js:16:15)
    at settle (C:\AI_Vtuber\TTS\node_modules\axios\lib\core\settle.js:17:12)
    at IncomingMessage.handleStreamEnd (C:\AI_Vtuber\TTS\node_modules\axios\lib\adapters\http.js:322:11)
    at IncomingMessage.emit (node:events:525:35)
    at IncomingMessage.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'User-Agent': 'OpenAI/NodeJS/3.1.0',
      Authorization: 'Bearer sk-',
      'OpenAI-Organization': 'org-',
      'Content-Length': 114
    },
    method: 'post',
    data: '{"model":"text-curie-001","prompt":"why?","temperature":0.9,"max_tokens":100,"stop":["ChatGPT:","Adrian Twarog:"]}',
    url: 'https://api.openai.com/v1/completions'
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: null,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'api.openai.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'api.openai.com',
      _readableState: [ReadableState],
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular *1],
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 82,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: true,
      [Symbol(kSetKeepAliveInitialDelay)]: 60,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object],
      [Symbol(RequestTimeout)]: undefined
    },
    _header: 'POST /v1/completions HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: application/json\r\n' +
      'User-Agent: OpenAI/NodeJS/3.1.0\r\n' +
      'Authorization: Bearer sk-\r\n' +
      'OpenAI-Organization: org-\r\n' +
      'Content-Length: 114\r\n' +
      'Host: api.openai.com\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object: null prototype],
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype],
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/v1/completions',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      socket: [TLSSocket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [Array],
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 429,
      statusMessage: 'Too Many Requests',
      client: [TLSSocket],
      _consuming: false,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'https://api.openai.com/v1/completions',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 14,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'api.openai.com',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 114,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'https://api.openai.com/v1/completions',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'user-agent': [Array],
      authorization: [Array],
      'openai-organization': [Array],
      'content-length': [Array],
      host: [Array]
    },
    [Symbol(kUniqueHeaders)]: null
  },
  response: {
    status: 429,
    statusText: 'Too Many Requests',
    headers: {
      date: 'Wed, 08 Mar 2023 13:18:15 GMT',
      'content-type': 'application/json; charset=utf-8',
      'content-length': '206',
      connection: 'close',
      vary: 'Origin',
      'x-request-id': '24af4fc67ab6f4268b2918154132e99f',
      'strict-transport-security': 'max-age=15724800; includeSubDomains' 
    },
    config: {
      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],
      method: 'post',
      data: '{"model":"text-curie-001","prompt":"why?","temperature":0.9,"max_tokens":100,"stop":["ChatGPT:","Adrian Twarog:"]}',
      url: 'https://api.openai.com/v1/completions'
    },
    request: <ref *1> ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: null,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'POST /v1/completions HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: application/json\r\n' +
        'User-Agent: OpenAI/NodeJS/3.1.0\r\n' +
        'Authorization: Bearer sk-\r\n' +
        'OpenAI-Organization: org-\r\n' +        
        'Content-Length: 114\r\n' +
        'Host: api.openai.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/v1/completions',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'api.openai.com',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
    data: { error: [Object] }
  },
  isAxiosError: true,
  toJSON: [Function: toJSON]
}
C:\AI_Vtuber\TTS\main.js:121
                Text: '<speak><prosody pitch="high">'+message+".................... "+gptResponse.data.choices[0].text+'</prosody></speak>',      

                         ^

TypeError: Cannot read properties of undefined (reading 'data')
    at client.<anonymous> (C:\AI_Vtuber\TTS\main.js:121:99)
    at processTicksAnnode main.js        ternal/process/task_queues:96:5)

from -prototype-aivtuber.

Lwnlcks avatar Lwnlcks commented on July 18, 2024

Resolved after switching to openai paid account

from -prototype-aivtuber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.