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

Request failed with status code 400 #6

Open
maorbar opened this issue Dec 3, 2022 · 4 comments
Open

Request failed with status code 400 #6

maorbar opened this issue Dec 3, 2022 · 4 comments

Comments

@maorbar
Copy link

maorbar commented Dec 3, 2022

Followed the steps in the youtube video. When running the code in replit, I get this error:
Sorry, there was an API error. The error was 'Request failed with status code 400'

Any ideas on how to fix it?

@heikog
Copy link

heikog commented Dec 9, 2022

same here

@SavvyEngineer
Copy link

same

@tingiris
Copy link
Member

tingiris commented Feb 3, 2023

Hey @maorbar, @heikog, and @SavvyEngineer - thanks for posting the issue. The reason is because OpenAI deprecated the answers endpoint which is used in this project. I'm planning to update this example with another aproach but have not had a chance to work on it yet. I'll ping you when the updates are done but in the meantime here is a link to the new aproach OpenAI is recomending. Thanks again.

@rrubio
Copy link

rrubio commented Feb 22, 2023

+1

@tingiris ? in terms of changes to the code. Is it something along these lines using openai package?

`
const embed_model = 'text-embedding-ada-002'

const documents = ([
"This app was built using JavaScript and Node.JS.<|endoftext|>",
"The app has a simple HTML form that users can use to submit questions.<|endoftext|>",
"GPT-3 will use documents provided by the developer as a knowledge base to derive answers from.<|endoftext|>",
"This is an example application that can be used to learn how to build apps using the OpenAI API.<|endoftext|>"
]).engine=embed_model
`

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

5 participants