Allow more complex provider setup in test

Created on 16 December 2024, 6 days ago

Problem/Motivation

📌 Provide a framework for testing with real providers Needs work introduces the ability to create tests that can be run against various providers. However, as highlighted in review, some providers require more complex set up than just a module and API key.

Steps to reproduce

Test with the Azure or AWS Bedrock providers.

Proposed resolution

Add a new, optional attribute for AI providers to use. \Drupal\Tests\ai\AiLlm\AiProviderTestBase::getProvider would then use this to perform additional set up. This attribute would have (all optional):

  • Modules to enable
  • Entity schema to install
  • Config to install
  • A callback to provide additional setup, which received the env set auth array, the desired provider/model, and the container.

API changes

A new, optional attribute and use of that in the test.

Data model changes

N/A

📌 Task
Status

Active

Version

1.0

Component

Miscellaneous

Created by

🇬🇧United Kingdom andrewbelcher

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

Comments & Activities

Production build 0.71.5 2024