- Issue created by @marcus_johansson
When setting up the AI module within a recipe, the problem always arises that a lot of the functionality is dependent on there being a setup provider available and a default operation type for what the 3rd party module is trying to achieve.
We have this issue in Drupal CMS and tried to fix it by creating the AI Simple Provider Installer, → where it would take care of this post install. This had one general issue on how to make the link available for it and it also made it necessary for 3rd party modules to have a graceful fallback, so they will not break just because a default provider is not set.
There is now a way of using input variables ✨ Make it possible for recipes to prompt for input values Fixed in D11. This works well in terminal and will soon be available when applying a recipe in the GUI as well.
On top of that there are custom action plugins for recipes, meaning that the AI core module can add a custom action plugin for recipes that will take care of:
input:
api_key:
data_type: string
description: The OpenAI API Key if you want to use OpenAI.
prompt:
method: ask
arguments:
question: 'Please provide your OpenAI API Key:'
default:
source: value
value: ''
config:
actions:
ai_provider_openai.settings:
setupAiProvider: # The new action
key_config_key: api_key # The (optional) config key that should take the keys entity id.
key_value: ${openai_api_key} # The (optional) value to take.
default_models: # The (optional) default models for operation types
chat: gpt-4o
text_to_image: dall-e3
simpleConfigUpdate: # This is to set other configurations
moderation: true
So as example for something like Ollama that doesn't set key entities, you could do
config:
actions:
ai_provider_ollama.settings:
setupAiProvider: [] # This just makes sure that the default operation types are set, if any
simpleConfigUpdate:
host: localhost
port: 11343
Active
1.0
AI Core module