- Issue created by @MrDaleSmith
- 🇬🇧United Kingdom scott_euser
That makes a ton of sense! Are you also envisioning having the forms in their own respective modules? Eg ai search housing the vector db one but also third party modules being allowing to add and have them auto found?
- 🇬🇧United Kingdom MrDaleSmith
Yeah I'm doing a general refactor, but currently the core AI module is providing the route for the collection of forms and I want to move that into this sub module and have it look across the site's codebase for any class implementing the new Interface and then generate a route automatically for them. That way ones that only work if a certain module is enabled won't appear in the list until the module gets turned on.
I'm also adding an isActive() call that will let each form return a FALSE if something (usually a Provider) isn't set up that it needs.
- Merge request !213Ensure that AI API Explorer forms can be provided by modules that provide additional functionality. → (Merged) created by MrDaleSmith
- 🇬🇧United Kingdom MrDaleSmith
OK, I think this is ready for review. The main thing to be considered is that I've added roave/better-reflection to assist with discovering Forms across the Drupal codebase: if this isn't wanted, we can do something similar to the basic Reflection used in the processor system; if it is, there may be follow up work to use it in the providers as well.
- 🇬🇧United Kingdom MrDaleSmith
@Marcus_Johansson I've made the requested changes, but between now and then I've realised this would be better to implement as more plugins: at the very least then we'd be able to remove the added roave/better-reflection depen dency that I needed to "discover" the forms. What do you think?
- 🇩🇪Germany marcus_johansson
Since the AI core module goes into the Drupal CMS, in general if we can get rid of or not add dependencies, that is a good thing, since they need to be approved by more people then the AI Core team. Especially for modules that are development modules, rather then production modules.
So if you can set the route without using dependencies, via plugins or some other way of discoverability that exists in Drupal's core libraries that would be great.
- 🇬🇧United Kingdom MrDaleSmith
OK @Marcus_Johansson I've refactored all of this as plugins. These's a final PHPCS error in the Annotation but I cannot fix it: there are no examples in Core or the AI module of setting the properties of an Annotation in the constructor so I'm wary of breaking things. If someone else knows how I'll let them demonstrate.
- 🇬🇧United Kingdom MrDaleSmith
Additional issues resolved. Ready for review again.
- Issue was unassigned.
- Status changed to Fixed
6 days ago 11:59am 16 December 2024 Automatically closed - issue fixed for 2 weeks with no activity.