Make it possible to use ConfigurableInterface for a FunctionCallInterface

Created on 17 March 2025, 21 days ago

Problem/Motivation

There might be users of FunctionCallInterface that wants to setup a configuration of something dependent to the tool, that should never be set as a parameter.

One example for instance - you have a video editing tool that requires ffmpeg. The path to an executable for ffmpeg, should never ever be a parameter, that would just be a security threat. This should be set once and always be used.

One simple solution for this is to allow anyone who uses the FunctionCallInterface, to extend it with the ConfigurableInterface and then have a configuration page for tools that are using this (or listing page with edit links if there are to many).

Is this a good way of solving it?

🌱 Plan
Status

Active

Version

1.1

Component

AI Core module

Created by

🇩🇪Germany marcus_johansson

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

Comments & Activities

  • Issue created by @marcus_johansson
  • 🇩🇪Germany marcus_johansson

    I think extending on this discussion is if we should use this to create derivatives of the original plugin. My initial thought was just to set this for security purposes, for values or setups that might be needed to use the tools, but they could be set elsewhere as well, since the tool belongs in a module in the end. But discussing this with @michaellander he showed how this can be much bigger than this.

    So take this example Create a tool that lists plugin definitions Active

    For a Drupal developer this makes sense that you could create derivatives, so you do not rewrite code unneccesarily. We could easily create a Field Type listing for instance that is a config derivative of the plugin definition tool. On that tool you could even set that could allow you to set the permissions needed to use it, for a specific deriative, something that otherwise might be hard to figure out.

    It should probably be an interface that is optional, or maybe that makes it not usable to be a base tool, but a tool that always have to be extended via the GUI.

    So one example how the Field Type listing tool would work:
    1. You would go to some path, where you can "Create Tool"
    2. In the list of base tools you would choose "Plugin Manager Listing"
    3. In the parameter Plugin Manager you would be able to use a required select list to pick the Plugin Manager of choice.
    4. Ajax would load the attribute values you can pick from via checkboxes, id would be autopicked.
    5. You can pick the permission needed to run this tool you create.
    6. In this case you can choose if you want to show and header
    7. You have to write your own function name and description.
    8. From other parameters that the deriative tool has picked as optional, you can choose to expose them, autofill them or ignore them.
    9. You click save - the tool is available.

    The only thing is that it might be a lot harder to read and understand the underlying code? The thought model of having one tool, map to one file of code is something that goes back to procedural programming and opens up the possibility for more people to understand what is happening.

    The question is if we should do this, or if we should live that there a tool file for everything.

Production build 0.71.5 2024