Problem/Motivation
Configuring the Azure AI Provider adding a chat model in the fieldset Model Data I'm asked to enter a Model ID.
The description for the field reads:
The model ID of the model you are using that you are using. This is for Drupal’s internals only and is not used with the provider. If no extra label is provided this will be the label.
So I input the value gpt_51_chat and fill our the rest of the form.
When I then try a chat request (via Field widget actions in my scenario) I get the following response:
Error invoking model response: Unknown model: gpt_51_chat
If I change the Model ID to the model ID as specified in Azure, gpt-5.1-chat, the chat request works as supposed.
Steps to reproduce
Se above.
Proposed resolution
Update the Model ID field description to make to user aware of the fact that the value will be used in requests to Azure. The value will be sent as part of the payload:
{ "messages" : [], "model": "<MODEL_ID>", ... }
Remaining tasks
Update field description.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork ai_provider_azure-3572778
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
peter törnstrand commentedI'm assigning myself as I intend to create a merge request for this issue.
Comment #3
peter törnstrand commentedOk, so it seems this field is part of the AI module:
Drupal\ai\OperationType\GenericType\AbstractModelFormBase. So the typo will have to be fixed in AI module repository and the description overridden for this module.Comment #4
peter törnstrand commentedI suggest the following field description:
Comment #6
peter törnstrand commentedComment #7
peter törnstrand commentedI wonder if I might make another change to the field description of the Endpoint field as I was struggling to get the correct value for this field.
What I ended up with was
https://<service name>.cognitiveservices.azure.com/openai/v1/chat/completionsfor a chat model.Perhaps we could supply example values? I have seen the following URLs:
It's not really clear what version to use even though the description includes:
Comment #8
peter törnstrand commentedOk, so this was not so simple as I thought. Entering a Model ID in the correct format for Azure results in form validation error when saving the model.
Comment #9
peter törnstrand commentedOk so I took a different approach instead. I added a new required field to the model config form, Model name with the following description:
Comment #10
marcus_johansson commentedComment #11
marcus_johansson commentedReviewing
Comment #12
marcus_johansson commentedNeeds a rebase and I added some comments.
Comment #13
joshua1234511Comment #14
joshua1234511Comment #15
jhuhta commentedI actually bumped into the same problem while developing another feature, and without knowing about this issue, solved it differently, by adding a model override config field and not load the meaning of the model name field. Let's see if I get that feature pushed soon.
Edit: the feature in question is here: #3614660: Support the Responses API
Comment #16
marcus_johansson commentedLGTM now.
Comment #17
joshua1234511Comment #18
joshua1234511@jhuhta, thanks for flagging. It's good to know we independently landed on the same root cause. This is merged now, so here's what's in there, in case it saves you work in #3614660:
Comment #20
arianraeesi commented