Problem/Motivation

There's no official date, but based on the verbiage spattered throughout in the docs sounds like it eventually will just be replaced:

Starting a new project? We recommend trying Responses to take advantage of the latest OpenAI platform features. Compare Chat Completions with Responses.

And

While Chat Completions remains supported, Responses is recommended for all new projects.

This also appears to have some performance impacts:

Better performance: Using reasoning models, like GPT-5, with Responses will result in better model intelligence when compared to Chat Completions. Our internal evals reveal a 3% improvement in SWE-bench with same prompt and setup.

Proposed resolution

Look into the changes required by both the providers and the AI base classes to make this BC but also enable newer features.

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

b_sharpe created an issue. See original summary.

efpapado’s picture

Assigned: Unassigned » efpapado

I started doing some work here. As a first approach, I'll copy the logic of the \Drupal\ai_provider_openai\Plugin\AiProvider\OpenAiProvider::chat + \Drupal\ai\OperationType\Chat\ChatInterface, to treat it as a different operation type, with its own AiApiExplorer plugin. I'm implementing the simplest possible request structure, and then it can be extended. I'm currently working on the 1.2.x branch.

efpapado’s picture

Assigned: efpapado » Unassigned
Status: Active » Needs review

Here is a first attempt. It is the simplest possible, not covering all the possible options.
It will be combined with another MR to the core AI module that will add a Responses Generator.
It includes also a Responses Generator plugin.

My thought was to just implement the communication to the Responses endpoint independently, as a separate operation type, while keep using the Chat as default. When the Responses is ready, we could decide on the next step, which could be either moving the default actions to Responses, or offer it as a configuration option.