Use Drupal AI's provider system instead of hardcoding OpenAI endpoints

Created on 9 April 2025, 5 days ago

Problem/Motivation

The current code calls OpenAI endpoints directly although the module is dependent on the AI module.
The default provider set by the AI module config should be fetched.

Steps to reproduce

NA

Proposed resolution

1. Rename and refactore OpenAiKeyService to be a more general AI provider service:
- Leverage the AI provider plugin manager to get providers
- Use the standard AI module's methods for provider selection
2. Updated the SmartLinkerAI plugin to:
- Remove direct HTTP client dependencies
- Use the AI module's provider system for sending requests
- Properly handle provider selection from configuration
3. Updated service definitions and dependencies in smartlinker_ai.services.yml
4. Improved documentation in the README to clarify dependencies

Remaining tasks

NA

User interface changes

NA

API changes

NA

Data model changes

NA

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇮🇳India Vivek Panicker Kolkata

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024