Unrecognized request argument supplied: tools

AI-generated summary

In a support thread titled “Unrecognized request argument supplied: tools,” user Parker1090 reports an error while setting up the AI bot on their Discourse community using Azure OpenAI. The error — Unrecognized request argument supplied: tools — occurs during API calls despite correct configuration of endpoints and keys. sam quickly identifies the issue: the API version used (2023-07-01-preview or 2023-05-15) is outdated. They recommend upgrading to api-version=2023-12-01-preview sam. Parker1090 confirms the fix works after updating the version, expressing relief at the simple solution. merefield chimes in, noting they faced a nearly identical issue recently, joking about Microsoft’s custom API versions. The thread highlights a common Azure OpenAI configuration pitfall and offers a clear, working fix for others encountering the same error.

Hi everyone

After finding the AI bot blog post, thought we’d give it a go on our community site and see how we can use it. First time using it, so apologies if this is a simple solution :sweat_smile:

We’ve set it up with Azure, with the below settings, but seeing the following error in /logs:

DiscourseAi::Completions::Endpoints::OpenAi: status: 404 - body: {
  "error": {
    "message": "Unrecognized request argument supplied: tools",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

Job exception: DiscourseAi::Completions::Endpoints::Base::CompletionFailed

Settings -

Setting Value
ai_openai_gpt35_url https://[custom url].openai.azure.com/openai/deployments/[deployment name]/chat/completions?api-version=2023-07-01-preview
ai_openai_gpt35_16k_url https://[custom url].openai.azure.com/openai/deployments/[deployment-name]/chat/completions?api-version=2023-07-01-preview
ai_openai_api_key api key
ai_bot_enabled checked / ticked
ai_bot_enabled_chat_bots gpt-3.5-turbo

Have we missed anything, or is there anything in particular we should be looking for?

Thanks in advance

Oh yeah you need to use the latest api version for azure it’s supplied in the ? arg

Thanks for the quick reply @sam!

We’ve tried it with ?api-version=2023-05-15, too, which we believe to be the last stable version, but still no joy.

Is that what you’re referring to, here?

Yeah that’s it , you want api-version=2023-12-01-preview

Brilliant. So simple if you know what you’re looking for :sweat_smile:

But it works!

Almost exactly the issue I ran into with Chatbot recently.

Microsoft and their bespoke API’s! :sweat_smile: