I opened a Postman to test my token and it seems that it works ok:
POST https://api.openai.com/v1/completions
{
"model": "text-davinci-003",
"prompt": "What do you think about Scriabin?",
"max_tokens": 1000
}
Response:
{
"id": "cmpl-6wrGoxk2yBPIOsLhLFad2yhWbf6Pt",
"object": "text_completion",
"created": 1679485814,
"model": "text-davinci-003",
"choices": [
{
"text": "\n\nScriabin was a Russian composer and pianist known for his visionary approach to music, particularly his focus on the connection between sound, colors and the human soul. His music is often described as metaphysical and visionary and is still today highly coveted by classical music enthusiasts.",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 55,
"total_tokens": 64
}
}
I use the same API token for this extension but it doesn't work and there's no log about what is failing.
P.S. I notice that when I create a discussion and ask a question and press the post button, it takes some time, so apparently the API is generating a completion. However no answer appears following the initial post. It makes me wonder whether the extension actually uses the correct Flarum functionality for posting the completion? Maybe there's a Flarum error after all and not ChatGPT one?