gptanswers-node icon indicating copy to clipboard operation
gptanswers-node copied to clipboard

Request failed with status code 400

Open maorbar opened this issue 2 years ago • 4 comments

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?

maorbar avatar Dec 03 '22 17:12 maorbar

same here

heikog avatar Dec 09 '22 12:12 heikog

same

SavvyEngineer avatar Jan 30 '23 16:01 SavvyEngineer

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.

tingiris avatar Feb 03 '23 15:02 tingiris

+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 `

rrubio avatar Feb 22 '23 21:02 rrubio