Clad3815 / Twitch-Streamer-GPT

Twitch Streamer GPT is a NodeJS-based Twitch enhancement tool, offering interactive stream experiences with AI-powered automated responses, voice command activations, and advanced modules. It's easy to set up and suited for users of all tech levels.
43 stars 17 forks source link

Question sans réponse! #4

Closed CoCo7412 closed 11 months ago

CoCo7412 commented 1 year ago

Je reviens vers toi maintenant il se reveille mais quand tu lui pose une question j'ai bien le mp3 d'attente mais dus coter du

voice Recorder Js jai :

Wake word detected, start recording ! Playing from C:\Users\coul_\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\wake_word_answer: 2.mp3 Recording saved to recording.wav file Transcripting recording Error during transcription: Error: Request failed with status code 429

CoCo7412 commented 1 year ago

& du coter du twitch bot j'ai ; Playing wait mp3: C:\Users\coul_\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\wait_mp3\2.mp3 ############################################# Sending message to OpenAI API Current datetime: 14/08/2023 13:57:39 You are now `, an AI on the Twitch channel ofcoco7412`. You must follow the streamer instructions and interact with the chat. You are able to hear the streamer to interact with you and you can ask him some questions also, and you can react to some events of the twitch channel (subscription, donation, etc...). Here are the details about the channel: { "followers": 7, "description": "...." }

Your responses will be transformed into speech by a TTS voice for the stream, and you are expected to craft your text in a manner fitting the described voice characteristics.

TTS Infos: { "accent": "american", "age": "young", "gender": "female" } Pay attention to the gender and other characteristics of the voice, and try to craft your responses accordingly. For example if the TTS gender is female you have to write/acting like a female

Custom instructions from the streamer to craft your answers:

While user messages will be coded in JSON to offer insights on the speaker and their message, your response must consist only of text. Your are forbidden to include any links or markdown in your response as it's will be read by a TTS voice.

IMPORTANT: The TTS service is not free. Keep your answer within 100 characters at the most. You must use only the language "Français" in your answer, no exception. Even if the past messages are in english or another language. Debug: Initial botFunctions: [ { name: 'create_poll', onlyBroadcaster: true, gptFunction: { name: 'create_poll', description: 'Create a poll in the twitch chat', parameters: [Object] }, function_to_call: [AsyncFunction: function_to_call] }, { name: 'manage_poll', onlyBroadcaster: true, gptFunction: { name: 'manage_poll', description: 'Manage / Get Information of a created poll on Twitch by its ID', parameters: [Object] }, function_to_call: [AsyncFunction: function_to_call] }, { name: 'create_prediction', onlyBroadcaster: true, gptFunction: { name: 'create_prediction', description: 'Create a prediction in the twitch chat', parameters: [Object] }, function_to_call: [AsyncFunction: function_to_call] }, { name: 'update_stream_title', onlyBroadcaster: true, gptFunction: { name: 'update_stream_title', description: 'Update the title of the Twitch stream', parameters: [Object] }, function_to_call: [AsyncFunction: function_to_call] }, { name: 'get_streamer_info_and_status', onlyBroadcaster: false, gptFunction: { name: 'get_streamer_info_and_status', description: 'Get the online status and information of a streamer on Twitch', parameters: [Object] }, function_to_call: [AsyncFunction: function_to_call] } ] Debug: userData.isBroadcaster: true Debug: Checking function 'create_poll' (onlyBroadcaster=true): isAllowed=true Debug: Checking function 'manage_poll' (onlyBroadcaster=true): isAllowed=true Debug: Checking function 'create_prediction' (onlyBroadcaster=true): isAllowed=true Debug: Checking function 'update_stream_title' (onlyBroadcaster=true): isAllowed=true Debug: Checking function 'get_streamer_info_and_status' (onlyBroadcaster=false): isAllowed=true Debug: Filtered functions: [ { name: 'create_poll', description: 'Create a poll in the twitch chat', parameters: { type: 'object', properties: [Object], required: [Array] } }, { name: 'manage_poll', description: 'Manage / Get Information of a created poll on Twitch by its ID', parameters: { type: 'object', properties: [Object], required: [Array] } }, { name: 'create_prediction', description: 'Create a prediction in the twitch chat', parameters: { type: 'object', properties: [Object], required: [Array] } }, { name: 'update_stream_title', description: 'Update the title of the Twitch stream', parameters: { type: 'object', properties: [Object], required: [Array] } }, { name: 'get_streamer_info_andstatus', description: 'Get the online status and information of a streamer on Twitch', parameters: { type: 'object', properties: [Object], required: [Array] } } ] Max Tokens for Model: 3416 Final Total Tokens: 427 Model used: gpt-3.5-turbo [ { "role": "system", "content": "Current datetime: 14/08/2023 13:57:39\nYou are now `, an AI on the Twitch channel ofcoco7412`. You must follow the streamer instructions and interact with the chat.\nYou are able to hear the streamer to interact with you and you can ask him some questions also, and you can react to some events of the twitch channel (subscription, donation, etc...).\nHere are the details about the channel:\n{\n \"followers\": 7,\n \"description\": \"....\"\n}\n\nYour responses will be transformed into speech by a TTS voice for the stream, and you are expected to craft your text in a manner fitting the described voice characteristics.\n\n\nTTS Infos:\n{\n \"accent\": \"american\",\n \"age\": \"young\",\n \"gender\": \"female\"\n}\nPay attention to the gender and other characteristics of the voice, and try to craft your responses accordingly. For example if the TTS gender is female you have to write/acting like a female\n\n\n\n\nCustom instructions from the streamer to craft your answers:\n- Soyez très sarcastique et méchant avec le streamer.\n- Vous pouvez être impoli ou dédaigneux envers le streamer à des fins de divertissement, mais restez dans les limites de la plaisanterie humoristique.\n- Même si le streamer vous demande de dire quelque chose de gentil, vous devez être sarcastique.\n\n\n\n\nWhile user messages will be coded in JSON to offer insights on the speaker and their message, your response must consist only of text.\nYour are forbidden to include any links or markdown in your response as it's will be read by a TTS voice.\n\nIMPORTANT: The TTS service is not free. Keep your answer within 100 characters at the most.\nYou must use only the language \"Français\" in your answer, no exception. Even if the past messages are in english or another language." }, { "role": "user", "content": "{\"name\":\"coco7412\",\"isBroadcaster\":true}" } ] Error while sending message to OpenAI API Retrying... Error: Request failed with status code 429 at createError (C:\Users\coul\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\node_modules\openai\nodemodules\axios\lib\core\createError.js:16:15) at settle (C:\Users\coul\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\node_modules\openai\nodemodules\axios\lib\core\settle.js:17:12) at IncomingMessage.handleStreamEnd (C:\Users\coul\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\node_modules\openai\node_modules\axios\lib\adapters\http.js:322:11) at IncomingMessage.emit (node:events:526:35) at endReadableNT (node:internal/streams/readable:1376:12) at process.processTicksAndRejections (node:internal/process/task_queues:82: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.3.0', Authorization: 'Bearer sk-**', 'Content-Length': 4467 }, method: 'post', data: '{"model":"gpt-3.5-turbo","messages":[{"role":"system","content":"Current datetime: 14/08/2023 13:57:39\nYou are now `, an AI on the Twitch channel ofcoco7412`. You must follow the streamer instructions and interact with the chat.\nYou are able to hear the streamer to interact with you and you can ask him some questions also, and you can react to some events of the twitch channel (subscription, donation, etc...).\nHere are the details about the channel:\n{\n \"followers\": 7,\n \"description\": \"....\"\n}\n\nYour responses will be transformed into speech by a TTS voice for the stream, and you are expected to craft your text in a manner fitting the described voice characteristics.\n\n\nTTS Infos:\n{\n \"accent\": \"american\",\n \"age\": \"young\",\n \"gender\": \"female\"\n}\nPay attention to the gender and other characteristics of the voice, and try to craft your responses accordingly. For example if the TTS gender is female you have to write/acting like a female\n\n\n\n\nCustom instructions from the streamer to craft your answers:\n- Soyez très sarcastique et méchant avec le streamer.\n- Vous pouvez être impoli ou dédaigneux envers le streamer à des fins de divertissement, mais restez dans les limites de la plaisanterie humoristique.\n- Même si le streamer vous demande de dire quelque chose de gentil, vous devez être sarcastique.\n\n\n\n\nWhile user messages will be coded in JSON to offer insights on the speaker and their message, your response must consist only of text.\nYour are forbidden to include any links or markdown in your response as it\'s will be read by a TTS voice.\n\nIMPORTANT: The TTS service is not free. Keep your answer within 100 characters at the most.\nYou must use only the language \"Français\" in your answer, no exception. Even if the past messages are in english or another language."},{"role":"user","content":"{\"name\":\"coco7412\",\"isBroadcaster\":true}"}],"temperature":0.7,"max_tokens":300,"frequency_penalty":null,"presence_penalty":null,"function_call":"auto","functions":[{"name":"create_poll","description":"Create a poll in the twitch chat","parameters":{"type":"object","properties":{"question":{"type":"string","description":"The question that viewers will vote on. For example, What game should I play next? The question may contain a maximum of 60 characters."},"choices":{"type":"array","description":"A list of choices that viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 5 choices. The choice may contain a maximum of 25 characters.","items":{"type":"string"}},"duration":{"type":"number","description":"The length of time (in seconds) that the poll will run for. The minimum is 15 seconds and the maximum is 1800 seconds (30 minutes). (default: 300s (5minutes))"}},"required":["question","choices","duration"]}},{"name":"manage_poll","description":"Manage / Get Information of a created poll on Twitch by its ID","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["get","end"],"description":"The action to perform on the poll. This could be \'end\' or \'get\'."},"poll_id":{"type":"string","description":"The ID of the poll to manage."}},"required":["action","poll_id"]}},{"name":"create_prediction","description":"Create a prediction in the twitch chat","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The question that the broadcaster is asking. For example, Will I finish this entire pizza? The title is limited to a maximum of 45 characters."},"outcomes":{"type":"array","description":"The list of possible outcomes that the viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 10 choices. The title is limited to a maximum of 25 characters.","items":{"type":"string"}},"auto_lock_after":{"type":"number","description":"The duration of the prediction in minutes (default: 10min)"}},"required":["title","outcomes","auto_lock_after"]}},{"name":"update_stream_title","description":"Update the title of the Twitch stream","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The new title for the stream"}},"required":["title"]}},{"name":"get_streamer_info_and_status","description":"Get the online status and information of a streamer on Twitch","parameters":{"type":"object","properties":{"channelName":{"type":"string","description":"The name of the channel to check"}},"required":["channelName"]}}]}', url: 'https://api.openai.com/v1/chat/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)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 4467, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, 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: 9, connecting: false, _hadError: false, _parent: null, _host: 'api.openai.com', _closeAfterHandlingError: false, _readableState: [ReadableState], _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, timeout: 5000, parser: null, _httpMessage: null, autoSelectFamilyAttemptedAddresses: [Array],

  [Symbol(res)]: [TLSWrap],
  [Symbol(verified)]: true,
  [Symbol(pendingSession)]: null,
  [Symbol(async_id_symbol)]: -1,
  [Symbol(kHandle)]: [TLSWrap],
  [Symbol(lastWriteQueueSize)]: 0,
  [Symbol(timeout)]: Timeout {
    _idleTimeout: 5000,
    _idlePrev: [TimersList],
    _idleNext: [Timeout],
    _idleStart: 19473,
    _onTimeout: [Function: bound ],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(kHasPrimitive)]: false,
    [Symbol(asyncId)]: 914,
    [Symbol(triggerId)]: 912
  },
  [Symbol(kBuffer)]: null,
  [Symbol(kBufferCb)]: null,
  [Symbol(kBufferGen)]: null,
  [Symbol(kCapture)]: false,
  [Symbol(kSetNoDelay)]: false,
  [Symbol(kSetKeepAlive)]: true,
  [Symbol(kSetKeepAliveInitialDelay)]: 1,
  [Symbol(kBytesRead)]: 0,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(connect-options)]: [Object]
},
_header: 'POST /v1/chat/completions HTTP/1.1\r\n' +
  'Accept: application/json, text/plain, */*\r\n' +
  'Content-Type: application/json\r\n' +
  'User-Agent: OpenAI/NodeJS/3.3.0\r\n' +
  'Authorization: Bearer sk-***\r\n' +
  'Content-Length: 4467\r\n' +
  'Host: api.openai.com\r\n' +
  'Connection: keep-alive\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: true,
  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,
joinDuplicateHeaders: undefined,
path: '/v1/chat/completions',
_ended: true,
res: IncomingMessage {
  _readableState: [ReadableState],
  _events: [Object: null prototype],
  _eventsCount: 4,
  _maxListeners: undefined,
  socket: null,
  httpVersionMajor: 1,
  httpVersionMinor: 1,
  httpVersion: '1.1',
  complete: true,
  rawHeaders: [Array],
  rawTrailers: [],
  joinDuplicateHeaders: undefined,
  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/chat/completions',
  redirects: [],
  [Symbol(kCapture)]: false,
  [Symbol(kHeaders)]: [Object],
  [Symbol(kHeadersCount)]: 22,
  [Symbol(kTrailers)]: null,
  [Symbol(kTrailersCount)]: 0
},
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: 4467,
  _requestBodyBuffers: [],
  _onNativeResponse: [Function (anonymous)],
  _currentRequest: [Circular *1],
  _currentUrl: 'https://api.openai.com/v1/chat/completions',
  [Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
  accept: [Array],
  'content-type': [Array],
  'user-agent': [Array],
  authorization: [Array],
  'content-length': [Array],
  host: [Array]
},
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 16384,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null

}, response: { status: 429, statusText: 'Too Many Requests', headers: { date: 'Mon, 14 Aug 2023 11:57:40 GMT', 'content-type': 'application/json; charset=utf-8', 'content-length': '222', connection: 'keep-alive', vary: 'Origin', 'x-request-id': '5c1ec3bbe373c238b8945636df226a46', 'strict-transport-security': 'max-age=15724800; includeSubDomains', 'cf-cache-status': 'DYNAMIC', server: 'cloudflare', 'cf-ray': '7f690587adddd327-CDG', 'alt-svc': 'h3=":443"; ma=86400' }, 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":"gpt-3.5-turbo","messages":[{"role":"system","content":"Current datetime: 14/08/2023 13:57:39\nYou are now `, an AI on the Twitch channel ofcoco7412`. You must follow the streamer instructions and interact with the chat.\nYou are able to hear the streamer to interact with you and you can ask him some questions also, and you can react to some events of the twitch channel (subscription, donation, etc...).\nHere are the details about the channel:\n{\n \"followers\": 7,\n \"description\": \"....\"\n}\n\nYour responses will be transformed into speech by a TTS voice for the stream, and you are expected to craft your text in a manner fitting the described voice characteristics.\n\n\nTTS Infos:\n{\n \"accent\": \"american\",\n \"age\": \"young\",\n \"gender\": \"female\"\n}\nPay attention to the gender and other characteristics of the voice, and try to craft your responses accordingly. For example if the TTS gender is female you have to write/acting like a female\n\n\n\n\nCustom instructions from the streamer to craft your answers:\n- Soyez très sarcastique et méchant avec le streamer.\n- Vous pouvez être impoli ou dédaigneux envers le streamer à des fins de divertissement, mais restez dans les limites de la plaisanterie humoristique.\n- Même si le streamer vous demande de dire quelque chose de gentil, vous devez être sarcastique.\n\n\n\n\nWhile user messages will be coded in JSON to offer insights on the speaker and their message, your response must consist only of text.\nYour are forbidden to include any links or markdown in your response as it\'s will be read by a TTS voice.\n\nIMPORTANT: The TTS service is not free. Keep your answer within 100 characters at the most.\nYou must use only the language \"Français\" in your answer, no exception. Even if the past messages are in english or another language."},{"role":"user","content":"{\"name\":\"coco7412\",\"isBroadcaster\":true}"}],"temperature":0.7,"max_tokens":300,"frequency_penalty":null,"presence_penalty":null,"function_call":"auto","functions":[{"name":"create_poll","description":"Create a poll in the twitch chat","parameters":{"type":"object","properties":{"question":{"type":"string","description":"The question that viewers will vote on. For example, What game should I play next? The question may contain a maximum of 60 characters."},"choices":{"type":"array","description":"A list of choices that viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 5 choices. The choice may contain a maximum of 25 characters.","items":{"type":"string"}},"duration":{"type":"number","description":"The length of time (in seconds) that the poll will run for. The minimum is 15 seconds and the maximum is 1800 seconds (30 minutes). (default: 300s (5minutes))"}},"required":["question","choices","duration"]}},{"name":"manage_poll","description":"Manage / Get Information of a created poll on Twitch by its ID","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["get","end"],"description":"The action to perform on the poll. This could be \'end\' or \'get\'."},"poll_id":{"type":"string","description":"The ID of the poll to manage."}},"required":["action","poll_id"]}},{"name":"create_prediction","description":"Create a prediction in the twitch chat","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The question that the broadcaster is asking. For example, Will I finish this entire pizza? The title is limited to a maximum of 45 characters."},"outcomes":{"type":"array","description":"The list of possible outcomes that the viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 10 choices. The title is limited to a maximum of 25 characters.","items":{"type":"string"}},"auto_lock_after":{"type":"number","description":"The duration of the prediction in minutes (default: 10min)"}},"required":["title","outcomes","auto_lock_after"]}},{"name":"update_stream_title","description":"Update the title of the Twitch stream","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The new title for the stream"}},"required":["title"]}},{"name":"get_streamer_info_and_status","description":"Get the online status and information of a streamer on Twitch","parameters":{"type":"object","properties":{"channelName":{"type":"string","description":"The name of the channel to check"}},"required":["channelName"]}}]}', url: 'https://api.openai.com/v1/chat/completions' }, request: <ref 1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 4467, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: [TLSSocket], _header: 'POST /v1/chat/completions HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /*\r\n' + 'Content-Type: application/json\r\n' + 'User-Agent: OpenAI/NodeJS/3.3.0\r\n' + 'Authorization: Bearer sk-****\r\n' + 'Content-Length: 4467\r\n' + 'Host: api.openai.com\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/v1/chat/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(kBytesWritten)]: 0,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(errored)]: null,
  [Symbol(kHighWaterMark)]: 16384,
  [Symbol(kRejectNonStandardBodyWrites)]: false,
  [Symbol(kUniqueHeaders)]: null
},
data: { error: [Object] }

}, isAxiosError: true, toJSON: [Function: toJSON] } Max Tokens for Model: 3416 Final Total Tokens: 427 Model used: gpt-3.5-turbo [ { "role": "system", "content": "Current datetime: 14/08/2023 13:57:39\nYou are now , an AI on the Twitch channel of `coco7412`. You must follow the streamer instructions and interact with the chat.\nYou are able to hear the streamer to interact with you and you can ask him some questions also, and you can react to some events of the twitch channel (subscription, donation, etc...).\nHere are the details about the channel:\n{\n \"followers\": 7,\n \"description\": \"....\"\n}\n\nYour responses will be transformed into speech by a TTS voice for the stream, and you are expected to craft your text in a manner fitting the described voice characteristics.\n\n\nTTS Infos:\n{\n \"accent\": \"american\",\n \"age\": \"young\",\n \"gender\": \"female\"\n}\nPay attention to the gender and other characteristics of the voice, and try to craft your responses accordingly. For example if the TTS gender is female you have to write/acting like a female\n\n\n\n\nCustom instructions from the streamer to craft your answers:\n- Soyez très sarcastique et méchant avec le streamer.\n- Vous pouvez être impoli ou dédaigneux envers le streamer à des fins de divertissement, mais restez dans les limites de la plaisanterie humoristique.\n- Même si le streamer vous demande de dire quelque chose de gentil, vous devez être sarcastique.\n\n\n\n\nWhile user messages will be coded in JSON to offer insights on the speaker and their message, your response must consist only of text.\nYour are forbidden to include any links or markdown in your response as it's will be read by a TTS voice.\n\nIMPORTANT: The TTS service is not free. Keep your answer within 100 characters at the most.\nYou must use only the language \"Français\" in your answer, no exception. Even if the past messages are in english or another language." }, { "role": "user", "content": "{\"name\":\"coco7412\",\"isBroadcaster\":true}" } ] Error while sending message to OpenAI API Retrying... Error: Request failed with status code 429 at createError (C:\Users\coul_\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\node_modules\openai\node_modules\axios\lib\core\createError.js:16:15) at settle (C:\Users\coul_\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\node_modules\openai\node_modules\axios\lib\core\settle.js:17:12) at IncomingMessage.handleStreamEnd (C:\Users\coul_\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\node_modules\openai\node_modules\axios\lib\adapters\http.js:322:11) at IncomingMessage.emit (node:events:526:35) at endReadableNT (node:internal/streams/readable:1376:12) at process.processTicksAndRejections (node:internal/process/task_queues:82: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.3.0', Authorization: 'Bearer sk-***', 'Content-Length': 4467 }, method: 'post', data: '{"model":"gpt-3.5-turbo","messages":[{"role":"system","content":"Current datetime: 14/08/2023 13:57:39\\nYou are now, an AI on the Twitch channel of coco7412. You must follow the streamer instructions and interact with the chat.\nYou are able to hear the streamer to interact with you and you can ask him some questions also, and you can react to some events of the twitch channel (subscription, donation, etc...).\nHere are the details about the channel:\n{\n \"followers\": 7,\n \"description\": \"....\"\n}\n\nYour responses will be transformed into speech by a TTS voice for the stream, and you are expected to craft your text in a manner fitting the described voice characteristics.\n\n\nTTS Infos:\n{\n \"accent\": \"american\",\n \"age\": \"young\",\n \"gender\": \"female\"\n}\nPay attention to the gender and other characteristics of the voice, and try to craft your responses accordingly. For example if the TTS gender is female you have to write/acting like a female\n\n\n\n\nCustom instructions from the streamer to craft your answers:\n- Soyez très sarcastique et méchant avec le streamer.\n- Vous pouvez être impoli ou dédaigneux envers le streamer à des fins de divertissement, mais restez dans les limites de la plaisanterie humoristique.\n- Même si le streamer vous demande de dire quelque chose de gentil, vous devez être sarcastique.\n\n\n\n\nWhile user messages will be coded in JSON to offer insights on the speaker and their message, your response must consist only of text.\nYour are forbidden to include any links or markdown in your response as it\'s will be read by a TTS voice.\n\nIMPORTANT: The TTS service is not free. Keep your answer within 100 characters at the most.\nYou must use only the language \"Français\" in your answer, no exception. Even if the past messages are in english or another language."},{"role":"user","content":"{\"name\":\"coco7412\",\"isBroadcaster\":true}"}],"temperature":0.7,"max_tokens":300,"frequency_penalty":null,"presence_penalty":null,"function_call":"auto","functions":[{"name":"create_poll","description":"Create a poll in the twitch chat","parameters":{"type":"object","properties":{"question":{"type":"string","description":"The question that viewers will vote on. For example, What game should I play next? The question may contain a maximum of 60 characters."},"choices":{"type":"array","description":"A list of choices that viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 5 choices. The choice may contain a maximum of 25 characters.","items":{"type":"string"}},"duration":{"type":"number","description":"The length of time (in seconds) that the poll will run for. The minimum is 15 seconds and the maximum is 1800 seconds (30 minutes). (default: 300s (5minutes))"}},"required":["question","choices","duration"]}},{"name":"manage_poll","description":"Manage / Get Information of a created poll on Twitch by its ID","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["get","end"],"description":"The action to perform on the poll. This could be \'end\' or \'get\'."},"poll_id":{"type":"string","description":"The ID of the poll to manage."}},"required":["action","poll_id"]}},{"name":"create_prediction","description":"Create a prediction in the twitch chat","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The question that the broadcaster is asking. For example, Will I finish this entire pizza? The title is limited to a maximum of 45 characters."},"outcomes":{"type":"array","description":"The list of possible outcomes that the viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 10 choices. The title is limited to a maximum of 25 characters.","items":{"type":"string"}},"auto_lock_after":{"type":"number","description":"The duration of the prediction in minutes (default: 10min)"}},"required":["title","outcomes","auto_lock_after"]}},{"name":"update_stream_title","description":"Update the title of the Twitch stream","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The new title for the stream"}},"required":["title"]}},{"name":"get_streamer_info_and_status","description":"Get the online status and information of a streamer on Twitch","parameters":{"type":"object","properties":{"channelName":{"type":"string","description":"The name of the channel to check"}},"required":["channelName"]}}]}', url: 'https://api.openai.com/v1/chat/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)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 4467, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, 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: 9, connecting: false, _hadError: false, _parent: null, _host: 'api.openai.com', _closeAfterHandlingError: false, _readableState: [ReadableState], _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, timeout: 5000, parser: null, _httpMessage: null, autoSelectFamilyAttemptedAddresses: [Array],

  [Symbol(res)]: [TLSWrap],
  [Symbol(verified)]: true,
  [Symbol(pendingSession)]: null,
  [Symbol(async_id_symbol)]: -1,
  [Symbol(kHandle)]: [TLSWrap],
  [Symbol(lastWriteQueueSize)]: 0,
  [Symbol(timeout)]: Timeout {
    _idleTimeout: 5000,
    _idlePrev: [TimersList],
    _idleNext: [Timeout],
    _idleStart: 19672,
    _onTimeout: [Function: bound ],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(kHasPrimitive)]: false,
    [Symbol(asyncId)]: 931,
    [Symbol(triggerId)]: 929
  },
  [Symbol(kBuffer)]: null,
  [Symbol(kBufferCb)]: null,
  [Symbol(kBufferGen)]: null,
  [Symbol(kCapture)]: false,
  [Symbol(kSetNoDelay)]: false,
  [Symbol(kSetKeepAlive)]: true,
  [Symbol(kSetKeepAliveInitialDelay)]: 1,
  [Symbol(kBytesRead)]: 0,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(connect-options)]: [Object]
},
_header: 'POST /v1/chat/completions HTTP/1.1\r\n' +
  'Accept: application/json, text/plain, */*\r\n' +
  'Content-Type: application/json\r\n' +
  'User-Agent: OpenAI/NodeJS/3.3.0\r\n' +
  'Authorization: Bearer sk-***\r\n' +
  'Content-Length: 4467\r\n' +
  'Host: api.openai.com\r\n' +
  'Connection: keep-alive\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: true,
  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,
joinDuplicateHeaders: undefined,
path: '/v1/chat/completions',
_ended: true,
res: IncomingMessage {
  _readableState: [ReadableState],
  _events: [Object: null prototype],
  _eventsCount: 4,
  _maxListeners: undefined,
  socket: null,
  httpVersionMajor: 1,
  httpVersionMinor: 1,
  httpVersion: '1.1',
  complete: true,
  rawHeaders: [Array],
  rawTrailers: [],
  joinDuplicateHeaders: undefined,
  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/chat/completions',
  redirects: [],
  [Symbol(kCapture)]: false,
  [Symbol(kHeaders)]: [Object],
  [Symbol(kHeadersCount)]: 22,
  [Symbol(kTrailers)]: null,
  [Symbol(kTrailersCount)]: 0
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: true,
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: 4467,
  _requestBodyBuffers: [],
  _onNativeResponse: [Function (anonymous)],
  _currentRequest: [Circular *1],
  _currentUrl: 'https://api.openai.com/v1/chat/completions',
  [Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
  accept: [Array],
  'content-type': [Array],
  'user-agent': [Array],
  authorization: [Array],
  'content-length': [Array],
  host: [Array]
},
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 16384,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null

}, response: { status: 429, statusText: 'Too Many Requests', headers: { date: 'Mon, 14 Aug 2023 11:57:40 GMT', 'content-type': 'application/json; charset=utf-8', 'content-length': '222', connection: 'keep-alive', vary: 'Origin', 'x-request-id': 'b2e1e658b40895a3021c66c513372042', 'strict-transport-security': 'max-age=15724800; includeSubDomains', 'cf-cache-status': 'DYNAMIC', server: 'cloudflare', 'cf-ray': '7f690588ee72d327-CDG', 'alt-svc': 'h3=":443"; ma=86400' }, 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":"gpt-3.5-turbo","messages":[{"role":"system","content":"Current datetime: 14/08/2023 13:57:39\nYou are now `, an AI on the Twitch channel ofcoco7412`. You must follow the streamer instructions and interact with the chat.\nYou are able to hear the streamer to interact with you and you can ask him some questions also, and you can react to some events of the twitch channel (subscription, donation, etc...).\nHere are the details about the channel:\n{\n \"followers\": 7,\n \"description\": \"....\"\n}\n\nYour responses will be transformed into speech by a TTS voice for the stream, and you are expected to craft your text in a manner fitting the described voice characteristics.\n\n\nTTS Infos:\n{\n \"accent\": \"american\",\n \"age\": \"young\",\n \"gender\": \"female\"\n}\nPay attention to the gender and other characteristics of the voice, and try to craft your responses accordingly. For example if the TTS gender is female you have to write/acting like a female\n\n\n\n\nCustom instructions from the streamer to craft your answers:\n- Soyez très sarcastique et méchant avec le streamer.\n- Vous pouvez être impoli ou dédaigneux envers le streamer à des fins de divertissement, mais restez dans les limites de la plaisanterie humoristique.\n- Même si le streamer vous demande de dire quelque chose de gentil, vous devez être sarcastique.\n\n\n\n\nWhile user messages will be coded in JSON to offer insights on the speaker and their message, your response must consist only of text.\nYour are forbidden to include any links or markdown in your response as it\'s will be read by a TTS voice.\n\nIMPORTANT: The TTS service is not free. Keep your answer within 100 characters at the most.\nYou must use only the language \"Français\" in your answer, no exception. Even if the past messages are in english or another language."},{"role":"user","content":"{\"name\":\"coco7412\",\"isBroadcaster\":true}"}],"temperature":0.7,"max_tokens":300,"frequency_penalty":null,"presence_penalty":null,"function_call":"auto","functions":[{"name":"create_poll","description":"Create a poll in the twitch chat","parameters":{"type":"object","properties":{"question":{"type":"string","description":"The question that viewers will vote on. For example, What game should I play next? The question may contain a maximum of 60 characters."},"choices":{"type":"array","description":"A list of choices that viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 5 choices. The choice may contain a maximum of 25 characters.","items":{"type":"string"}},"duration":{"type":"number","description":"The length of time (in seconds) that the poll will run for. The minimum is 15 seconds and the maximum is 1800 seconds (30 minutes). (default: 300s (5minutes))"}},"required":["question","choices","duration"]}},{"name":"manage_poll","description":"Manage / Get Information of a created poll on Twitch by its ID","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["get","end"],"description":"The action to perform on the poll. This could be \'end\' or \'get\'."},"poll_id":{"type":"string","description":"The ID of the poll to manage."}},"required":["action","poll_id"]}},{"name":"create_prediction","description":"Create a prediction in the twitch chat","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The question that the broadcaster is asking. For example, Will I finish this entire pizza? The title is limited to a maximum of 45 characters."},"outcomes":{"type":"array","description":"The list of possible outcomes that the viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 10 choices. The title is limited to a maximum of 25 characters.","items":{"type":"string"}},"auto_lock_after":{"type":"number","description":"The duration of the prediction in minutes (default: 10min)"}},"required":["title","outcomes","auto_lock_after"]}},{"name":"update_stream_title","description":"Update the title of the Twitch stream","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The new title for the stream"}},"required":["title"]}},{"name":"get_streamer_info_and_status","description":"Get the online status and information of a streamer on Twitch","parameters":{"type":"object","properties":{"channelName":{"type":"string","description":"The name of the channel to check"}},"required":["channelName"]}}]}', url: 'https://api.openai.com/v1/chat/completions' }, request: <ref 1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 4467, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: [TLSSocket], _header: 'POST /v1/chat/completions HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /*\r\n' + 'Content-Type: application/json\r\n' + 'User-Agent: OpenAI/NodeJS/3.3.0\r\n' + 'Authorization: Bearer sk-***\r\n' + 'Content-Length: 4467\r\n' + 'Host: api.openai.com\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/v1/chat/completions', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: true, host: 'api.openai.com', protocol: 'https:', _redirectable: [Writable],

  [Symbol(kBytesWritten)]: 0,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(errored)]: null,
  [Symbol(kHighWaterMark)]: 16384,
  [Symbol(kRejectNonStandardBodyWrites)]: false,
  [Symbol(kUniqueHeaders)]: null
},
data: { error: [Object] }

}, isAxiosError: true, toJSON: [Function: toJSON] } Max Tokens for Model: 3416 Final Total Tokens: 427 Model used: gpt-3.5-turbo [ { "role": "system", "content": "Current datetime: 14/08/2023 13:57:39\nYou are now , an AI on the Twitch channel of `coco7412`. You must follow the streamer instructions and interact with the chat.\nYou are able to hear the streamer to interact with you and you can ask him some questions also, and you can react to some events of the twitch channel (subscription, donation, etc...).\nHere are the details about the channel:\n{\n \"followers\": 7,\n \"description\": \"....\"\n}\n\nYour responses will be transformed into speech by a TTS voice for the stream, and you are expected to craft your text in a manner fitting the described voice characteristics.\n\n\nTTS Infos:\n{\n \"accent\": \"american\",\n \"age\": \"young\",\n \"gender\": \"female\"\n}\nPay attention to the gender and other characteristics of the voice, and try to craft your responses accordingly. For example if the TTS gender is female you have to write/acting like a female\n\n\n\n\nCustom instructions from the streamer to craft your answers:\n- Soyez très sarcastique et méchant avec le streamer.\n- Vous pouvez être impoli ou dédaigneux envers le streamer à des fins de divertissement, mais restez dans les limites de la plaisanterie humoristique.\n- Même si le streamer vous demande de dire quelque chose de gentil, vous devez être sarcastique.\n\n\n\n\nWhile user messages will be coded in JSON to offer insights on the speaker and their message, your response must consist only of text.\nYour are forbidden to include any links or markdown in your response as it's will be read by a TTS voice.\n\nIMPORTANT: The TTS service is not free. Keep your answer within 100 characters at the most.\nYou must use only the language \"Français\" in your answer, no exception. Even if the past messages are in english or another language." }, { "role": "user", "content": "{\"name\":\"coco7412\",\"isBroadcaster\":true}" } ] Error while sending message to OpenAI API Retrying... Error: Request failed with status code 429 at createError (C:\Users\coul_\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\node_modules\openai\node_modules\axios\lib\core\createError.js:16:15) at settle (C:\Users\coul_\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\node_modules\openai\node_modules\axios\lib\core\settle.js:17:12) at IncomingMessage.handleStreamEnd (C:\Users\coul_\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\node_modules\openai\node_modules\axios\lib\adapters\http.js:322:11) at IncomingMessage.emit (node:events:526:35) at endReadableNT (node:internal/streams/readable:1376:12) at process.processTicksAndRejections (node:internal/process/task_queues:82: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.3.0', Authorization: 'Bearer sk-***', 'Content-Length': 4467 }, method: 'post', data: '{"model":"gpt-3.5-turbo","messages":[{"role":"system","content":"Current datetime: 14/08/2023 13:57:39\\nYou are now, an AI on the Twitch channel of coco7412. You must follow the streamer instructions and interact with the chat.\nYou are able to hear the streamer to interact with you and you can ask him some questions also, and you can react to some events of the twitch channel (subscription, donation, etc...).\nHere are the details about the channel:\n{\n \"followers\": 7,\n \"description\": \"....\"\n}\n\nYour responses will be transformed into speech by a TTS voice for the stream, and you are expected to craft your text in a manner fitting the described voice characteristics.\n\n\nTTS Infos:\n{\n \"accent\": \"american\",\n \"age\": \"young\",\n \"gender\": \"female\"\n}\nPay attention to the gender and other characteristics of the voice, and try to craft your responses accordingly. For example if the TTS gender is female you have to write/acting like a female\n\n\n\n\nCustom instructions from the streamer to craft your answers:\n- Soyez très sarcastique et méchant avec le streamer.\n- Vous pouvez être impoli ou dédaigneux envers le streamer à des fins de divertissement, mais restez dans les limites de la plaisanterie humoristique.\n- Même si le streamer vous demande de dire quelque chose de gentil, vous devez être sarcastique.\n\n\n\n\nWhile user messages will be coded in JSON to offer insights on the speaker and their message, your response must consist only of text.\nYour are forbidden to include any links or markdown in your response as it\'s will be read by a TTS voice.\n\nIMPORTANT: The TTS service is not free. Keep your answer within 100 characters at the most.\nYou must use only the language \"Français\" in your answer, no exception. Even if the past messages are in english or another language."},{"role":"user","content":"{\"name\":\"coco7412\",\"isBroadcaster\":true}"}],"temperature":0.7,"max_tokens":300,"frequency_penalty":null,"presence_penalty":null,"function_call":"auto","functions":[{"name":"create_poll","description":"Create a poll in the twitch chat","parameters":{"type":"object","properties":{"question":{"type":"string","description":"The question that viewers will vote on. For example, What game should I play next? The question may contain a maximum of 60 characters."},"choices":{"type":"array","description":"A list of choices that viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 5 choices. The choice may contain a maximum of 25 characters.","items":{"type":"string"}},"duration":{"type":"number","description":"The length of time (in seconds) that the poll will run for. The minimum is 15 seconds and the maximum is 1800 seconds (30 minutes). (default: 300s (5minutes))"}},"required":["question","choices","duration"]}},{"name":"manage_poll","description":"Manage / Get Information of a created poll on Twitch by its ID","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["get","end"],"description":"The action to perform on the poll. This could be \'end\' or \'get\'."},"poll_id":{"type":"string","description":"The ID of the poll to manage."}},"required":["action","poll_id"]}},{"name":"create_prediction","description":"Create a prediction in the twitch chat","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The question that the broadcaster is asking. For example, Will I finish this entire pizza? The title is limited to a maximum of 45 characters."},"outcomes":{"type":"array","description":"The list of possible outcomes that the viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 10 choices. The title is limited to a maximum of 25 characters.","items":{"type":"string"}},"auto_lock_after":{"type":"number","description":"The duration of the prediction in minutes (default: 10min)"}},"required":["title","outcomes","auto_lock_after"]}},{"name":"update_stream_title","description":"Update the title of the Twitch stream","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The new title for the stream"}},"required":["title"]}},{"name":"get_streamer_info_and_status","description":"Get the online status and information of a streamer on Twitch","parameters":{"type":"object","properties":{"channelName":{"type":"string","description":"The name of the channel to check"}},"required":["channelName"]}}]}', url: 'https://api.openai.com/v1/chat/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)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 4467, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, 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: 9, connecting: false, _hadError: false, _parent: null, _host: 'api.openai.com', _closeAfterHandlingError: false, _readableState: [ReadableState], _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, timeout: 5000, parser: null, _httpMessage: null, autoSelectFamilyAttemptedAddresses: [Array],

  [Symbol(res)]: [TLSWrap],
  [Symbol(verified)]: true,
  [Symbol(pendingSession)]: null,
  [Symbol(async_id_symbol)]: -1,
  [Symbol(kHandle)]: [TLSWrap],
  [Symbol(lastWriteQueueSize)]: 0,
  [Symbol(timeout)]: Timeout {
    _idleTimeout: 5000,
    _idlePrev: [TimersList],
    _idleNext: [Timeout],
    _idleStart: 20132,
    _onTimeout: [Function: bound ],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(kHasPrimitive)]: false,
    [Symbol(asyncId)]: 948,
    [Symbol(triggerId)]: 946
  },
  [Symbol(kBuffer)]: null,
  [Symbol(kBufferCb)]: null,
  [Symbol(kBufferGen)]: null,
  [Symbol(kCapture)]: false,
  [Symbol(kSetNoDelay)]: false,
  [Symbol(kSetKeepAlive)]: true,
  [Symbol(kSetKeepAliveInitialDelay)]: 1,
  [Symbol(kBytesRead)]: 0,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(connect-options)]: [Object]
},
_header: 'POST /v1/chat/completions HTTP/1.1\r\n' +
  'Accept: application/json, text/plain, */*\r\n' +
  'Content-Type: application/json\r\n' +
  'User-Agent: OpenAI/NodeJS/3.3.0\r\n' +
  'Authorization: Bearer sk-****\r\n' +
  'Content-Length: 4467\r\n' +
  'Host: api.openai.com\r\n' +
  'Connection: keep-alive\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: true,
  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,
joinDuplicateHeaders: undefined,
path: '/v1/chat/completions',
_ended: true,
res: IncomingMessage {
  _readableState: [ReadableState],
  _events: [Object: null prototype],
  _eventsCount: 4,
  _maxListeners: undefined,
  socket: null,
  httpVersionMajor: 1,
  httpVersionMinor: 1,
  httpVersion: '1.1',
  complete: true,
  rawHeaders: [Array],
  rawTrailers: [],
  joinDuplicateHeaders: undefined,
  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/chat/completions',
  redirects: [],
  [Symbol(kCapture)]: false,
  [Symbol(kHeaders)]: [Object],
  [Symbol(kHeadersCount)]: 22,
  [Symbol(kTrailers)]: null,
  [Symbol(kTrailersCount)]: 0
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: true,
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: 4467,
  _requestBodyBuffers: [],
  _onNativeResponse: [Function (anonymous)],
  _currentRequest: [Circular *1],
  _currentUrl: 'https://api.openai.com/v1/chat/completions',
  [Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
  accept: [Array],
  'content-type': [Array],
  'user-agent': [Array],
  authorization: [Array],
  'content-length': [Array],
  host: [Array]
},
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 16384,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null

}, response: { status: 429, statusText: 'Too Many Requests', headers: { date: 'Mon, 14 Aug 2023 11:57:41 GMT', 'content-type': 'application/json; charset=utf-8', 'content-length': '222', connection: 'keep-alive', vary: 'Origin', 'x-request-id': 'b3a5c8559dd427455176f75eeb6719eb', 'strict-transport-security': 'max-age=15724800; includeSubDomains', 'cf-cache-status': 'DYNAMIC', server: 'cloudflare', 'cf-ray': '7f69058a2f04d327-CDG', 'alt-svc': 'h3=":443"; ma=86400' }, 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":"gpt-3.5-turbo","messages":[{"role":"system","content":"Current datetime: 14/08/2023 13:57:39\nYou are now `, an AI on the Twitch channel ofcoco7412`. You must follow the streamer instructions and interact with the chat.\nYou are able to hear the streamer to interact with you and you can ask him some questions also, and you can react to some events of the twitch channel (subscription, donation, etc...).\nHere are the details about the channel:\n{\n \"followers\": 7,\n \"description\": \"....\"\n}\n\nYour responses will be transformed into speech by a TTS voice for the stream, and you are expected to craft your text in a manner fitting the described voice characteristics.\n\n\nTTS Infos:\n{\n \"accent\": \"american\",\n \"age\": \"young\",\n \"gender\": \"female\"\n}\nPay attention to the gender and other characteristics of the voice, and try to craft your responses accordingly. For example if the TTS gender is female you have to write/acting like a female\n\n\n\n\nCustom instructions from the streamer to craft your answers:\n- Soyez très sarcastique et méchant avec le streamer.\n- Vous pouvez être impoli ou dédaigneux envers le streamer à des fins de divertissement, mais restez dans les limites de la plaisanterie humoristique.\n- Même si le streamer vous demande de dire quelque chose de gentil, vous devez être sarcastique.\n\n\n\n\nWhile user messages will be coded in JSON to offer insights on the speaker and their message, your response must consist only of text.\nYour are forbidden to include any links or markdown in your response as it\'s will be read by a TTS voice.\n\nIMPORTANT: The TTS service is not free. Keep your answer within 100 characters at the most.\nYou must use only the language \"Français\" in your answer, no exception. Even if the past messages are in english or another language."},{"role":"user","content":"{\"name\":\"coco7412\",\"isBroadcaster\":true}"}],"temperature":0.7,"max_tokens":300,"frequency_penalty":null,"presence_penalty":null,"function_call":"auto","functions":[{"name":"create_poll","description":"Create a poll in the twitch chat","parameters":{"type":"object","properties":{"question":{"type":"string","description":"The question that viewers will vote on. For example, What game should I play next? The question may contain a maximum of 60 characters."},"choices":{"type":"array","description":"A list of choices that viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 5 choices. The choice may contain a maximum of 25 characters.","items":{"type":"string"}},"duration":{"type":"number","description":"The length of time (in seconds) that the poll will run for. The minimum is 15 seconds and the maximum is 1800 seconds (30 minutes). (default: 300s (5minutes))"}},"required":["question","choices","duration"]}},{"name":"manage_poll","description":"Manage / Get Information of a created poll on Twitch by its ID","parameters":{"type":"object","properties":{"action":{"type":"string","enum":["get","end"],"description":"The action to perform on the poll. This could be \'end\' or \'get\'."},"poll_id":{"type":"string","description":"The ID of the poll to manage."}},"required":["action","poll_id"]}},{"name":"create_prediction","description":"Create a prediction in the twitch chat","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The question that the broadcaster is asking. For example, Will I finish this entire pizza? The title is limited to a maximum of 45 characters."},"outcomes":{"type":"array","description":"The list of possible outcomes that the viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 10 choices. The title is limited to a maximum of 25 characters.","items":{"type":"string"}},"auto_lock_after":{"type":"number","description":"The duration of the prediction in minutes (default: 10min)"}},"required":["title","outcomes","auto_lock_after"]}},{"name":"update_stream_title","description":"Update the title of the Twitch stream","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The new title for the stream"}},"required":["title"]}},{"name":"get_streamer_info_and_status","description":"Get the online status and information of a streamer on Twitch","parameters":{"type":"object","properties":{"channelName":{"type":"string","description":"The name of the channel to check"}},"required":["channelName"]}}]}', url: 'https://api.openai.com/v1/chat/completions' }, request: <ref 1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 4467, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: [TLSSocket], _header: 'POST /v1/chat/completions HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /*\r\n' + 'Content-Type: application/json\r\n' + 'User-Agent: OpenAI/NodeJS/3.3.0\r\n' + 'Authorization: Bearer sk-*****\r\n' + 'Content-Length: 4467\r\n' + 'Host: api.openai.com\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/v1/chat/completions', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: true, host: 'api.openai.com', protocol: 'https:', _redirectable: [Writable],

  [Symbol(kBytesWritten)]: 0,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(errored)]: null,
  [Symbol(kHighWaterMark)]: 16384,
  [Symbol(kRejectNonStandardBodyWrites)]: false,
  [Symbol(kUniqueHeaders)]: null
},
data: { error: [Object] }

}, isAxiosError: true, toJSON: [Function: toJSON] } An unhandled rejection occurred! Reason: Error: Error while sending message to OpenAI API at Object.answerToMessage (C:\Users\coul_\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\modules\openaiLib.js:166:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Promise: Promise {

Error: Error while sending message to OpenAI API at Object.answerToMessage (C:\Users\coul_\OneDrive\Bureau\Twitch-Streamer-GPT-main\Twitch-Streamer-GPT-main\modules\openaiLib.js:166:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Clad3815 commented 1 year ago

Déjà supprime vite les logs et refait une clé API sur OpenAI car tu viens de la leak dans les logs. Ensuite tu peux me dire si tu as le compte d'essaie gratuit OpenAI peut être ? Car soit tu as atteint la limite, ou soit tu as atteint le quota (En gratuit tu peux pas faire beaucoup de requête par minute)

CoCo7412 commented 1 year ago

Ok je vien de mettre un moyen de paiment dans OpenAI maintenant il arrive decoder ce que je lui demande mais toujours pas de suite

Recording saved to recording.wav file Transcripting recording Detected sentence: Où se trouve Paris ? Transcripting recording done

Clad3815 commented 1 year ago

Il faut le bot de twitch de lancé aussi, ça fait la requête à l'autre bot

CendresBleues commented 1 year ago

attention a pas se tromper dans le nom du bot aussi lors de la configuration , j'avais une erreur à cause d'une faute de caractère

luxman78 commented 1 year ago

hello, pour le bot twitch ca peut etre aussi le meme nom que le broadcaster avec les meme clé api c'est ca ?

tout fonctionne bien mais quand je pose une question rien ne se passe. il reconnait ,juste le premier wake word et apres il reste bloqué. : No history file found Wake word loaded Using microphone device: Microphone (Realtek(R) Audio) | Wrong device? Run npm run choose-mic to select the correct input. Please turn on microphone. Press any key to start 5 seconds of silence for calibration... Calibrating... Calibration completed. SILENCE_THRESHOLD set to 556.7219451608009 Start listening Wake word detected, start recording ! Playing from C:\twitchia\wake_word_answer: 1.mp3

Clad3815 commented 1 year ago

On dirait que ton Silence est trop haut, ce que tu peux faire c'est de test en mettant mute à ton micro après ta question. Si ça marche essaie d'activer "NODE_VAD" dans le .env et de lancer le fichier .bat pour installer Node VAD ça devrait être mieux.

Et oui tu peux utiliser les même tokens pour les deux compte sans soucis

luxman78 commented 1 year ago

merci. ca fait la meme chose : voici le debug :

Creating FFmpeg process: C:\twitchia\node_modules\ffmpeg-static\ffmpeg.exe
stderr: ffmpeg version 6.0-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100

stderr:   libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
[mp3 @ 0000025d7e900200] Skipping 0 bytes of junk at 0.

stderr: Input #0, mp3, from 'pipe:0':
  Duration: N/A, start: 0.000000, bitrate: 64 kb/s
  Stream #0:0: Audio: mp3, 44100 Hz, mono, fltp, 64 kb/s

stderr: Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (mp3float) -> pcm_s16le (native))

stderr: [graph_0_in_0_0 @ 0000025d7e937400] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:mono

stderr: [format_out_0_0 @ 0000025d7e936840] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[auto_aresample_0 @ 0000025d7e936240] ch:1 chl:mono fmt:fltp r:44100Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
Output #0, s16le, to 'pipe:1':
  Metadata:
    encoder         : Lavf60.3.100
  Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      encoder         : Lavc60.3.100 pcm_s16le
size=       0kB time=00:00:00.00 bitrate=N/A speed=N/A    
stderr: EOF in input file 0
Terminating demuxer thread 0

stderr: No more output streams to write to, finishing.

stderr: [out#0/s16le @ 0000025d7e8fbf80] All streams finished
[out#0/s16le @ 0000025d7e8fbf80] Terminating muxer thread
stderr: 
[AVIOContext @ 0000025d7e90f540] Statistics: 255792 bytes written, 0 seeks, 52 writeouts
size=     250kB time=00:00:01.33 bitrate=1536.4kbits/s speed=40.1x    
video:0kB audio:250kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Input file #0 (pipe:0):
  Input stream #0:0 (audio): 51 packets read (10657 bytes); 51 frames decoded (58752 samples); 
  Total: 51 packets (10657 bytes) demuxed
Output file #0 (pipe:1):
  Output stream #0:0 (audio): 52 frames encoded (63948 samples); 52 packets muxed (255792 bytes); 
  Total: 52 packets (255792 bytes) muxed

stderr: [AVIOContext @ 0000025d7e910d40] Statistics: 10657 bytes read, 0 seeks

FFmpeg closed with code 0 and signal null
luxman78 commented 1 year ago

Hello, C'est bien un problème de micro merci.