Problem/Motivation

Looking at the code we basically allow all the chat models to be allowed with tools and structured content. This is not true, see https://platform.openai.com/docs/models/gpt-3.5-turbo for instance.

We need to add the check to exclude these models.

Steps to reproduce

Install the AI module and the AI provider.
Setup OpenAI
Visit /admin/config/ai/settings and check the models for Chat with Tools and Chat with Structured Content.
You can pick 3.5 there.

Proposed resolution

Check which models actually supports this. Anything after 4.1 does it. Make sure to verify reasoning models like o1 or o3.
Add so that only these models are pickable with those capabilities.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon 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

marcus_johansson created an issue. See original summary.

arianraeesi’s picture

nickolaj made their first commit to this issue’s fork.

nickolaj’s picture

Status: Active » Needs review

Added capability checks in `getModels()` for `ChatTools`, `ChatStructuredResponse`, and `ChatCombinedToolsAndStructuredResponse`. These filter models to GPT-4.1+, GPT-4o, GPT-4-turbo, GPT-5, and o-series (o1, o3, o4), preventing older models like GPT-3.5 from being offered for these features.

danrod’s picture

Assigned: Unassigned » danrod
danrod’s picture

StatusFileSize
new158.24 KB
new203.25 KB
new208.82 KB
new202.51 KB

I tested this and initially, works as expected.

Chat models before the change (you can pick the old 3.5 models here):

Chat models before the change

Chat models after the change:

Chat models after the change

You won't be able to pick the old ChatGPT models (3.5).

But if you go to Chat Generation Explorer /admin/config/ai/explorers/chat_generator, you can still pick the old models, that needs to be addresed:

Chat models after the change, with the old models still available

The chatbox after picking a new model seems to be working though:

Chatbox working

danrod’s picture

Assigned: danrod » Unassigned
Status: Needs review » Needs work
marcus_johansson’s picture

Actually the API Explorer is generic and should show any chat model available - so as long it is not showing text to image models or something else, its working as it should be.

The restricted chat listings are for agents, automators or other things that might request it.

danrod’s picture

Hi @marcus_johansson , thanks for the clarification, as discussed in Slack, I'll move it to RTBC

danrod’s picture

Status: Needs work » Reviewed & tested by the community

a.dmitriiev made their first commit to this issue’s fork.

  • a.dmitriiev committed 44fbb031 on 1.1.x
    Issue #3572299: Added capability checks in `getModels()` for `Chat...
    
a.dmitriiev’s picture

Status: Reviewed & tested by the community » Fixed

Merged to 1.2.x and backported to 1.1.x

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

arianraeesi’s picture

Issue tags: -AI Product Development

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.