Calling Open AI API
-
Hi everyone π I’m just starting to learn some developpement basics and i have a project in mind, but after spending a lot of time in research i find my self lost !
I would like to do the folowing on a simple wordpress page, using any theme (don’t think the theme here is relevant)
I would like to create a simple form (that i can do ahah)
then use the content inserted to replace the “prompt” in the curl request, to make an call to the OPEN AI API so i can generate content for my users.
This is the curl request provided ny OPEN AI :
curl https://api.openai.com/v1/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -d '{ "model": "text-davinci-002", "prompt": "Create an outline for an essay about Nikola Tesla and his contributions to technology:", "temperature": 0, "max_tokens": 150, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0 }But now i’m stuck. How can i make this call to the OPEN AI API from wordpress ?
Any guidance, or reading i should do, or step by step explanation would be amazing !
The topic ‘Calling Open AI API’ is closed to new replies.