In a discussion titled ‘OpenAI Azure endpoint support for gpt-4-32k?’, user peyrusse reports issues with the Azure OpenAI endpoint when using gpt-4-32k, specifically noting that the model gpt-4-32k-2023-07-01-preview is not handled in lib/summarization/entry_point.rb. Logs reveal a 400 error: ‘Unrecognized request argument supplied: tools’ peyrusse. Falco suggests the issue stems from needing an updated endpoint with tool support, confirming Azure can handle it internally. Zak argues it’s not Azure-specific, pointing to the plugin’s abstraction layer and tracing the error to lib/completions/endpoints/open_ai.rb, where payload[:tools] = dialect.tools is invoked. Falco recommends using api-version=2023-12-01-preview, which peyrusse agrees to test. Ultimately, peyrusse confirms the issue is resolved after updating the Discourse AI plugin. The thread also includes unrelated queries from peyrusse about forking, testing, and activating Discourse plugins, though no responses address these.
DiscourseAi::Completions::Endpoints::OpenAi: status: 400 - body: {
"error": {
"message": "Unrecognized request argument supplied: tools",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
Préparation du payload avec prompt: [{:role=>"system", :content=>"You are a helpful Discourse assistant.\nYou _understand_ and **generate** Discourse Markdown.\nYou live in a Discourse Forum Message.\n\nYou live in the forum with the URL: https://<URL>\nThe title of your site: Discourse\nThe description is: \nThe participants in this conversation are: gpt4_bot, Chris\nThe date now is: 2024-01-19 10:10:05 UTC, much has changed since you were trained.\n\nYou were trained on OLD data, lean on search to get up to date information about this forum\nWhen searching try to SIMPLIFY search terms\nDiscourse search joins all terms with AND. Reduce and simplify terms to find more results."}, {:role=>"user", :content=>"comment faire une boucle en dart ?", :name=>"Chris"}], model_params: {}, dialect: #<DiscourseAi::Completions::Dialects::ChatGpt:0x00007f230513e6e0>
No, I don’t think it’s a specificity of Microsoft Azure, I’ve tested the requests in pure JavaScript and it works without any problems, without any notion of “tools”. Here, I have the impression that it’s a problem with the plugin (I specify that I’m not a Ruby developer) but it seems that the abstraction layer used makes things more complicated. In doubt, we forked that plugin and put debuggers everywhere, the URL, the headers that go to Azure are 100% compliant.
It is not, as long as you are using an up to date endpoint.
We are using Azure endpoints on this site, but with the parameter being api-version=2023-12-01-preview. Can you try using an endpoint with that API version?