Problem/Motivation

Currently there is no way of setting a default provider at all in the Field Validations. This means that any recipe with this, will have to be shipped with a specific provider and model and have that as a hard dependency.

We should fix so that it has the option to pick a default model, that is actually using the default model.

Proposed resolution

  • For all the ValidationRule files, add a default model for the the options with the key `__default`. For the Image it should be default chat_with_vision.
  • Add a validation of the form when its being saved and picked, that a default model is set, otherwise fail.
  • In the constraint validators, load the provider and model from defaults, if the $constraint->model is `__default`. If that is for some reason unavailable, throw an error.

Comments

marcus_johansson created an issue. See original summary.

marcus_johansson’s picture

Category: Task » Feature request
marcus_johansson’s picture

Project: AI (Artificial Intelligence) » AI Validations
Version: 1.2.x-dev »
Component: AI Validations » Code
abhisekmazumdar’s picture

Version: » 1.3.x-dev
Status: Active » Closed (duplicate)

This issue is resolved by MR !3 in #3586397: Switch FieldValidationRule plugins to the Provider Configuration Form Element. That MR switches all four rule plugins to use the ai_provider_configuration form element with #default_provider_allowed => TRUE, and adds resolveProviderOption() in AiConstraintValidatorBase to fall back to the site-wide default at validation time when no provider is explicitly set. Storing an empty string (rather than a hardcoded provider ID) when "Default" is selected ensures the fallback path is always taken.

Marking this as duplicate.

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.