Open wilenius opened 11 months ago
Hi @wilenius
thank you for providing GPT Model via Azure OpenAI. We did some tests in our Moodle (V4.1.9+) with your plugin version together with Azure AI and we do not get any generated questions. We activate debugging and there is following Warning:
Warning: Undefined property: stdClass::$addidentifier in /var/www/html/mymoodle/local/aiquestions/story.php on line 77 Error: questions were not created
Do you have any idea whats wrong?
thanks & best regards, Anton
We've been using it in production on 4.2.x for half a year now. I don't get any debug errors. Does your Azure API work when you use it with curl or something?
Take a look at the cron logs, or try running the branch on a local development instance, and launch the cron manually, so you'll see the output in the terminal.
Hi @wilenius
thank you for your tips to find the problem. Now I found the problem, I made a mistake in the URL of Azure API Endpoint. So, if any other has the same problem, the API endpoint should like this
https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/chat/completions?api-version=YYYY-MM-TT
best regards, Anton
Glad you managed to fix it!
Our organization uses GPT models via the Azure OpenAI service (https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models), which needs some additional settings and a bit differently formed HTTP header in order to work. I have a working fork already, and I was thinking about adding additional settings for the plugin that allows the selection between OpenAI API and Azure API, and the insertion of the custom Azure API endpoint.
I'll make a pull request, hopefully within a couple of days.