I tried to run the example for Azure OpenAi in the documentation, however it seems that the API changed. I used the version 0.8.1.

After I got it to work, I adapted the code from the documentation accordingly.

I hope the changes fit. Let me know if you want me to adjust anything.