gpt4-pdf-chatbot-langchain
gpt4-pdf-chatbot-langchain copied to clipboard
404 Error from OpenAI using `gpt-4` modelName
When I set the modelName to gpt-4
in makechain.ts, I'm getting a 404 response from OpenAI. Snippets of the error message include:
response: {
status: 404,
statusText: 'Not Found'
request: <ref *1> ClientRequest {
_header: 'POST /v1/chat/completions HTTP/1.1\r\n'
'Host: api.openai.com\r\n' +
...
isAxiosError: true
When I set the modelName to gpt-3.5-turbo
everything works as expected. Doing a little digging, it appears the URL for gpt-4 may have recently changed.
Same issue here.
I should also add that I have a paid account and access to gpt-4
so that is not the issue.
Yes, same here.
I guess the issue is that we are not on the beta list even tho we pay for the subscription:
edit: nevermind, other people have gpt-4 API access and still get 404.
You need to have GPT-4 access for the API.
I received the email "You're invited to use the OpenAI GPT-4 API!", but also get the 404.
Me too
Me too. Everything works withGPT 3.5-turbo, but with GPT-4 I get no response. I have a paid subscription and have tried pinecone on both the EU and US side. Anyone?
import os import openai openai.api_key = '' openai.Model.list()
you can run this py script to see what models you have access to
Same issue. I have GPT4 access, but no luck. Everything works with 3.5 Turbo.
Having access to GPT-4 via a plus account is not enough. You need to put yourself on the GPT-4 API waitlist to be able to use the GPT-4 API.
I have the same problem. Got the gpt-4 API access. Confirmed by email. But when I pass 'gpt-4' as model I get a 404 error code. Anybody got a solution ?
I am facing the same problem. I ran next build: I got the following output in the terminal. info - Loaded env from C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main.env info - Linting and checking validity of types info - Using wasm build of next-swc warn - Attempted to load @next/swc-win32-x64-gnu, but it was not installed warn - Attempted to load @next/swc-win32-x64-msvc, but it was not installed info - Creating an optimized production build info - Compiled successfully info - Collecting page data [ ] info - Generating static pages (0/3)TypeError: Cannot read properties of null (reading 'useContext') at exports.useContext (C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main\node_modules\react\cjs\react.production.min.js:24:118) at Head (C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main.next\server\chunks\109.js:266:34) at Wc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:68:44) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:70:253) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:89) at $c (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:78:98) at bd (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:77:404) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:217) at $c (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:78:98) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:71:145)
Error occurred prerendering page "/404". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: Cannot read properties of null (reading 'useContext') at exports.useContext (C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main\node_modules\react\cjs\react.production.min.js:24:118) at Head (C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main.next\server\chunks\109.js:266:34) at Wc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:68:44) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:70:253) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:89) at $c (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:78:98) at bd (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:77:404) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:217) at $c (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:78:98) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:71:145) TypeError: Cannot read properties of null (reading 'useContext') at exports.useContext (C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main\node_modules\react\cjs\react.production.min.js:24:118) at Head (C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main.next\server\chunks\109.js:266:34) at Wc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:68:44) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:70:253) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:89) at $c (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:78:98) at bd (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:77:404) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:217) at $c (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:78:98) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:71:145)
Error occurred prerendering page "/500". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: Cannot read properties of null (reading 'useContext') at exports.useContext (C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main\node_modules\react\cjs\react.production.min.js:24:118) at Head (C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main.next\server\chunks\109.js:266:34) at Wc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:68:44) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:70:253) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:89) at $c (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:78:98) at bd (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:77:404) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:217) at $c (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:78:98) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:71:145) [= ] info - Generating static pages (2/3)TypeError: Cannot read properties of null (reading 'useState') at exports.useState (C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main\node_modules\react\cjs\react.production.min.js:25:394) at Home (C:\Users\DrGopakumar\gpt4-pdf-chatbot-langchain-main.next\server\pages\index.js:237:78) at Wc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:68:44) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:70:253) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:89) at $c (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:78:98) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:71:145) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:89) at Zc (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:71:479) at Z (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\react-dom\cjs\react-dom-server.browser.production.min.js:76:89) info - Generating static pages (3/3)
Build error occurred Error: Export encountered errors on following paths: / /_error: /404 /_error: /500 at C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\export\index.js:425:19 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Span.traceAsyncFn (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\trace\trace.js:79:20) at async C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\build\index.js:1403:21 at async Span.traceAsyncFn (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\trace\trace.js:79:20) at async C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\build\index.js:1261:17 at async Span.traceAsyncFn (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\trace\trace.js:79:20) at async Object.build [as default] (C:\Users\DrGopakumar\Documents\gpt4-pdf\gpt4-pdf-chatbot-langchain-main\gpt4-pdf-chatbot-langchain-main\node_modules\next\dist\build\index.js:72:29) Any body gets similar errors ? I have a paid GPT-4 model. Pinecone ingest was successful. Can any body help ?
I have also encountered the same problem, and I have confirmed that I have joined the openai waitlist.
When I call the API https://api.openai.com/v1/chat/completions with the model gpt-4-0314 or gpt-4, I get got a 404.
When I switched to gpt-3.5-turbo it worked success.
Folks, Did you find a solution? I found something that seems to be working.. I paid for GPT Plus access which gives me GPT-4 on ChatGPT via chat.openai.com only. This doesn't mean that I got access to GPT-4 API.
Given the situation, I followed the suggestion from @cchgray , I did this by putting in my key: import os import openai openai.api_key = 'my-key' print(openai.Model.list()) # I had to print it otherwise it wouldn't list the model
then I did this:
(appenv) root@ip-172-30-1-95:/sw/chatGPTExcelAnalyzer# python3 checkGPT-4.py | grep '"id"' | grep 'gpt-4' ... and got nothin.... for my key...
Then, I did this: (appenv) root@ip-172-30-1-95:/sw/chatGPTExcelAnalyzer# python3 checkGPT-4.py | grep '"id"' | grep 'davinci' "id": "davinci", "id": "text-davinci-edit-001", "id": "code-davinci-edit-001", "id": "text-davinci-001", "id": "davinci-search-document", "id": "davinci-instruct-beta", "id": "text-search-davinci-query-001", "id": "davinci-search-query", "id": "text-davinci-003", "id": "text-search-davinci-doc-001", "id": "text-similarity-davinci-001", "id": "text-davinci-002", "id": "davinci-similarity", "id": "davinci:2020-05-03", "id": "if-davinci-v2", "id": "if-davinci:3.0.0", "id": "davinci-if:3.0.0", "id": "davinci-instruct-beta:2.0.0", "id": "text-davinci:001",
Then, I chose "text-davinci-003" instead of "gpt-3.5-turbo" and the results are already better. I am still waitlisted for my GPT-4 API access. Once granted, I expect the models available will be as follows:
GPT-4 is currently in a limited beta and only accessible to those who have been granted access. Please join the waitlist to get access when capacity is available.
LATEST MODEL DESCRIPTION MAX TOKENS TRAINING DATA
gpt-4 More capable than any GPT-3.5 model, able to do more complex tasks, and optimized for chat. Will be updated with our latest model iteration. 8,192 tokens Up to Sep 2021 gpt-4-0314 Snapshot of gpt-4 from March 14th 2023. Unlike gpt-4, this model will not receive updates, and will be deprecated 3 months after a new version is released. 8,192 tokens Up to Sep 2021 gpt-4-32k Same capabilities as the base gpt-4 mode but with 4x the context length. Will be updated with our latest model iteration. 32,768 tokens Up to Sep 2021 gpt-4-32k-0314 Snapshot of gpt-4-32 from March 14th 2023. Unlike gpt-4-32k, this model will not receive updates, and will be deprecated 3 months after a new version is released. 32,768 tokens Up to Sep 2021
For many basic tasks, the difference between GPT-4 and GPT-3.5 models is not significant. However, in more complex reasoning situations, GPT-4 is much more capable than any of our previous models.
Facing same issue, getting 404 error when using model: 'gpt-4' but every thing works fine when using model: 'gpt-3.5-turbo'
d checking validity of types info - Using wasm build of next-swc warn - Attempted to load @next/swc-win32-x64-gnu, but it was not installed warn - Attempted to load @next/swc-win32-x64-msvc, but it was not installed info - Creating an optimized production build info - Compiled successfully
did you solve that
Hi, @discolando! I'm Dosu, and I'm helping the gpt4-pdf-chatbot-langchain team manage their backlog. I wanted to let you know that we are marking this issue as stale.
From what I understand, you and other users have been experiencing a 404 error when using the gpt-4
modelName in makechain.ts. Some users have suggested checking the available models using a Python script, but so far, no solution has been found. One user mentioned that they had success using the gpt-3.5-turbo
model instead.
Before we close this issue, we wanted to check with you if this issue is still relevant to the latest version of the gpt4-pdf-chatbot-langchain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
Thank you for your understanding and contribution to the gpt4-pdf-chatbot-langchain project!