Problem/Motivation
Content Studio currently relies on Drupal AI's “Chat with Structured Response” configuration when generating content from JSON structures.
This means Content Studio cannot independently select a model without potentially affecting other modules that use the same configuration. Content Studio should allow administrators to choose the model that best suits its content-generation requirements.
Steps to reproduce
- Configure an AI provider and model under Drupal AI's "Chat with Structured Response" settings.
- Use Content Studio to generate content from a JSON structure.
- Change the model selection to suit Content Studio's requirements.
- Observe that the shared Drupal AI configuration may also affect other modules using it.
Proposed resolution
Add an independent AI model selection option to Content Studio settings.
- Provide a dropdown listing all available AI provider and model combinations configured through Drupal AI.
- Include a default option: Use Drupal AI's Chat with Structured Response default.
- When the default option is selected, Content Studio should use the model configured in Drupal AI's Chat with Structured Response settings.
- When a specific provider and model are selected, Content Studio should use that selection for its AI operations without modifying Drupal AI's shared configuration.
- Reuse providers and credentials already configured through Drupal AI.
- Validate the selected provider and model and handle cases where they are unavailable or no longer configured.
- Ensure that Content Studio continues to support the structured response functionality required for JSON-based content generation.
Remaining tasks
- Implement the settings form and model-selection logic.
- Add automated tests for configuration, model selection, and error handling.
- Test content generation with different configured providers and models.
- Update documentation.
User interface changes
Add an AI provider and model selection field to Content Studio settings.
API changes
Update Content Studio's AI integration to use its configured provider and model, while retaining compatibility with Drupal AI.
Data model changes
Store the Content Studio-specific model selection in its configuration, using Drupal configuration schema and appropriate defaults.
Issue fork content_studio-3634035
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
gokulg commented