Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChatGPTError: ChatGPT error 404 after running node server.js #38

Open
Nevaehni opened this issue Feb 16, 2023 · 11 comments
Open

ChatGPTError: ChatGPT error 404 after running node server.js #38

Nevaehni opened this issue Feb 16, 2023 · 11 comments

Comments

@Nevaehni
Copy link

$ node --trace-warnings server.js

  • Training ChatGPT (1 plugin rules)(node:15400) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
    at emitExperimentalWarning (node:internal/util:226:11)
    at fetch (node:internal/process/pre_execution:213:5)
    at file:///C:/Users/Admin/Desktop/chatgpt-extension/chatgpt-chrome-extension/node_modules/chatgpt/build/index.js:193:31
    at new Promise ()
    at ChatGPTAPI.sendMessage (file:///C:/Users/Admin/Desktop/chatgpt-extension/chatgpt-chrome-extension/node_modules/chatgpt/build/index.js:149:23)
    at async Conversation.sendMessage (file:///C:/Users/Admin/Desktop/chatgpt-extension/chatgpt-chrome-extension/server.js:25:17)
    at async oraPromise (file:///C:/Users/Admin/Desktop/chatgpt-extension/chatgpt-chrome-extension/node_modules/ora/index.js:368:18)
    at async start (file:///C:/Users/Admin/Desktop/chatgpt-extension/chatgpt-chrome-extension/server.js:69:3)
    × Training ChatGPT (1 plugin rules)
    file:///C:/Users/Admin/Desktop/chatgpt-extension/chatgpt-chrome-extension/node_modules/chatgpt/build/index.js:202
    const error = new ChatGPTError(msg, { cause: res });
    ^

ChatGPTError: ChatGPT error 404: {
"error": {
"message": "That model does not exist",
"type": "invalid_request_error",
"param": null,
"code": null
}
}

at file:///C:/Users/Admin/Desktop/chatgpt-extension/chatgpt-chrome-extension/node_modules/chatgpt/build/index.js:202:29
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {

statusCode: 404,
statusText: 'Not Found',
[cause]: Response {
[Symbol(realm)]: null,
[Symbol(state)]: {
aborted: false,
rangeRequested: false,
timingAllowPassed: true,
requestIncludesCredentials: true,
type: 'default',
status: 404,
timingInfo: {
startTime: 366.8491999998223,
redirectStartTime: 0,
redirectEndTime: 0,
postRedirectStartTime: 366.8491999998223,
finalServiceWorkerStartTime: 0,
finalNetworkResponseStartTime: 0,
finalNetworkRequestStartTime: 0,
endTime: 0,
encodedBodySize: 0,
decodedBodySize: 0,
finalConnectionTimingInfo: null
},
cacheState: '',
statusText: 'Not Found',
headersList: HeadersList {
[Symbol(headers map)]: Map(7) {
'date' => 'Thu, 16 Feb 2023 22:35:28 GMT',
'content-type' => 'application/json; charset=utf-8',
'content-length' => '158',
'connection' => 'keep-alive',
'vary' => 'Origin',
'x-request-id' => '4482070b845f8d8f373759baf658719a',
'strict-transport-security' => 'max-age=15724800; includeSubDomains'
},
[Symbol(headers map sorted)]: null
},
urlList: [
<ref *1> URL {
[Symbol(context)]: URLContext {
flags: 400,
scheme: 'https:',
username: '',
password: '',
host: 'api.openai.com',
port: null,
path: [Array],
query: null,
fragment: null
},
[Symbol(query)]: URLSearchParams {
[Symbol(query)]: [],
[Symbol(context)]: [Circular *1]
}
}
],
body: {
stream: ReadableStream {
[Symbol(kType)]: 'ReadableStream',
[Symbol(kState)]: {
disturbed: true,
state: 'closed',
storedError: undefined,
stream: undefined,
transfer: [Object],
controller: [ReadableStreamDefaultController],
reader: undefined
},
[Symbol(used)]: true
}
}
},
[Symbol(headers)]: Headers {
[Symbol(headers list)]: HeadersList {
[Symbol(headers map)]: Map(7) {
'date' => 'Thu, 16 Feb 2023 22:35:28 GMT',
'content-type' => 'application/json; charset=utf-8',
'content-length' => '158',
'connection' => 'keep-alive',
'vary' => 'Origin',
'x-request-id' => '4482070b845f8d8f373759baf658719a',
'strict-transport-security' => 'max-age=15724800; includeSubDomains'
},
[Symbol(headers map sorted)]: null
},
[Symbol(guard)]: 'immutable',
[Symbol(realm)]: null
}
}
}

Node.js v18.8.0

@giscafer
Copy link

same error , if you can visit https://chat.openai.com/chat in your browser, i think this error is disapear

@Nevaehni
Copy link
Author

I can visit that link, but the error still persists.

@TonyLoveCoding
Copy link

Check this issue #31
AdamSiyala's advice can fix this 404 problem. At least it worked for me.

@ajesuscode
Copy link

ajesuscode commented Feb 23, 2023

You need to modify this part of code in server.js to write a correct model name
const gptApi = new ChatGPTAPI({ apiKey: process.env.OPENAI_API_KEY, completionParams: { model: "text-davinci-003", top_p: 0.8, }, maxResponseTokens: 300, }); console.log(gptApi);

@giscafer
Copy link

giscafer commented Feb 25, 2023

@ajesuscode answer form the extension is diference of official #40

@sandeepscet
Copy link

sandeepscet commented Feb 25, 2023

Able to solve by changing initialization in server.js, this is for free users who want to use without API Key.
Reverse-proxy

import { ChatGPTUnofficialProxyAPI  } from "chatgpt";
const gptApi = new ChatGPTUnofficialProxyAPI ({
   accessToken: process.env.OPENAI_ACCESS_TOKEN,
    apiReverseProxyUrl: 'https://chat.duti.tech/api/conversation  '
});

Users can generate using this URL and add token into .env file

@giscafer
Copy link

Able to solve by changing initialization in server.js, this is for free users who want to use without API Key. Reverse-proxy

const gptApi = new ChatGPTUnofficialProxyAPI ({
   accessToken: process.env.OPENAI_ACCESS_TOKEN,
    apiReverseProxyUrl: 'https://chat.duti.tech/api/conversation  '
});

Users can generate using this URL and add token into .env file

whitch module is the ChatGPTUnofficialProxyAPI import from?

@sandeepscet
Copy link

import { ChatGPTUnofficialProxyAPI } from "chatgpt";

@giscafer
Copy link

Able to solve by changing initialization in server.js, this is for free users who want to use without API Key. Reverse-proxy

import { ChatGPTUnofficialProxyAPI  } from "chatgpt";
const gptApi = new ChatGPTUnofficialProxyAPI ({
   accessToken: process.env.OPENAI_ACCESS_TOKEN,
    apiReverseProxyUrl: 'https://chat.duti.tech/api/conversation  '
});

Users can generate using this URL and add token into .env file

v4.7.2 works

@ajesuscode
Copy link

@ajesuscode answer form the extension is diference of official #40

Didn't get it)) Can you explain widely))?

@sbatam
Copy link

sbatam commented Apr 2, 2023

Able to solve by changing initialization in server.js, this is for free users who want to use without API Key. Reverse-proxy

import { ChatGPTUnofficialProxyAPI  } from "chatgpt";
const gptApi = new ChatGPTUnofficialProxyAPI ({
   accessToken: process.env.OPENAI_ACCESS_TOKEN,
    apiReverseProxyUrl: 'https://chat.duti.tech/api/conversation  '
});

Users can generate using this URL and add token into .env file

It's not working for me, can you please explain a bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants