Discourse AI plugin update breaks Azure AI compatibility

AI-generated summary

The latest update to the Discourse AI plugin broke compatibility with Azure AI, resulting in a 400 error due to an unknown parameter “stream_options” Yiffyi. This parameter is not present in the latest Azure AI API definition. Roman_Rizzi fixed the issue with a pull request. However, another problem was discovered where the plugin uses the endpoint configured for GPT-4 instead of GPT-4o Yiffyi. The site setting for GPT-4o is read but not used in the actual model_uri function.

After upgrading Discourse AI plugin to the latest version, GPT models with Azure AI stopped working, logs showed that:

DiscourseAi::Completions::Endpoints::OpenAi: status: 400 - body: {
  "error": {
    "message": "Unknown parameter: 'stream_options'.",
    "type": "invalid_request_error",
    "param": "stream_options",
    "code": "unknown_parameter"
  }
}

The latest Azure AI api definition could be found on GitHub. And stream_options hasn’t been there yet.

2 Likes

Thanks for letting us know. I fixed it here:

https://github.com/discourse/discourse-ai/pull/648

2 Likes

Hi! I updated the plugin and it works on Azure AI now. However, I found a new problem that the plugin seems to be using the endpoint configured for gpt-4 instead of gpt-4o. :face_with_hand_over_mouth:

The site setting of gpt-4o is only read at has_url?(model) function, but not used in the actual model_uri function.

Thank you for your time fixing this :sparkling_heart:

2 Likes

This topic was automatically closed after 3 days. New replies are no longer allowed.