Hi guys ๐ I am trying to access text-davinci-003 via Python. I have a Python script which dynamically loads request settings and prompts via info stored in a spreadsheet.
My aim is to generate prompts (in a spreadsheet) and fire them to Davinci-003 and then collect the responses. The application is to generate some product descriptions.
I would post a sample of the actual Python script, but I don't think it's really relevant or worth anyone's time to read. All you need to know is the request being made by the Python script. It is separated into "headers" and "data", as per the imported "requests" library / module. Instead I will focus on the output which is being sent to Open AI via Python / requests.
Here are the header and data outputs which are being fired to the Open AI API (examples).
Headers:
{'Authorization': 'sk-VALID-GENERATED-KEY', 'Content-Type': 'application/json'}
Above: note that the key is generated from Open-AI back-end. It is valid and not deleted. I am just not sharing the exact key (hope that's okay).
Data:
{'model': 'text-davinci-003', 'prompt': 'Write an 800 character product description for the product known as the Arlo Pro 3 Floodlight 2K Camera - Black. Use a technical and promotional writing style.', 'temperature': 0.5, 'max_tokens': 60.0, 'top_p': 0.3, 'frequency_penalty': 0.5, 'presence_penalty': 0.0}
The request URL is set to: https://api.openai.com/v1/completions
When I run the script, everything works but I get 401 response (instead of actual prompt responses). What have I done wrong? I have Asperger's sorry if I put this in the wrong place. I am also not a developer or programmer by trade, but I pick things like this up pretty quick with some minor assistance ๐