I have also fixed several Drupal 11 compatibility issues.
I have included also some coding standards clean up.
a.dmitriiev → created an issue.
Indeed ✨ Add Javascript orchestration for each loop in the Chatbot/Assistants API Active fixes this already, so closing this one
I will check this issue
a.dmitriiev → made their first commit to this issue’s fork.
Uploading patch to be used in composer based projects.
a.dmitriiev → created an issue.
Thank you, Vincent!
Hey @vbouchet,
Any chance that you can review this change? I tried to make it compatible with current state of Project Browser version 2. Everything works smoothly. I haven't checked the change with "Package manager" (I haven't tried to require and install the package from admin UI) yet. But maybe first this needs to be fixed.
Thank you.
Unfortunately, there is no content_template formatter therefor the patch is not correct. I have added the missing type
property, but it is just entity_reference_label
from core, as content templates doesn't provide any field formatter plugin.
Update hook was added. MR is merged.
Sorry, but I can't reproduce the issue. The error trace says the problem is in line:
$template_operations = parent::getOperations($entity);
But $entity there is the entity from the list row. And the method getOperations
is even type hinted, so are you sure you haven't made any modifications to that file?
It is enough to clear the caches for the new link to appear in the list, no need to re-install the module. I will add the update hook to clean the caches automatically.
a.dmitriiev → created an issue.
The fix in the MR makes sure that the contextual (balloon/bubble) menu that appears on text selection is displayed ONLY when the corresponding button is added to the toolbar (though it is not visible in CKEditor toolbar itself, only in admin UI when you configure the toolbar). If the button is not in "active" toolbar items, the menu will not appear on text selection (also when the AI CKEditor features are enabled).
Toolbar button only enables or disables the plugin, it is not even displayed in the CKEditor toolbar itself, this button is only visible in the "Text and format" admin UI page.
I have added a separate icon for the balloon menu.
a.dmitriiev → made their first commit to this issue’s fork.
It can be a setting in AI CKEditor plugin itself, but to have it completely separated it was decided to use a separate plugin for this, that has its own toolbar item and JS file. This way nothing is changed for existing sites (also the balloon code will not be even loaded), and if the users want balloon menu they just add the corresponding toolbar item.
The button was introduced in this issue ✨ Make "AI Assistant" functionality available through contextual (baloon) menu Active . Probably something went wrong when merging all the issues together and the bubble menu is displayed when it is not supposed to, this was not the case when it was still in MR. Changing this to "Bug".
Thank you @annmarysruthy, I have also done some clean up, as the base class already provides some form common form fields that are not needed anymore in the plugin class if not overriden.
a.dmitriiev → made their first commit to this issue’s fork.
I have fixed the issues mentioned in the MR comments.
Regarding "throw away code" I disagree. You mention that there is now a way to get the context, but it is only available for method vectorSearch
, how would it be retrieved in any other method of the class if needed?
Test failure:
Fatal error: Declaration of Drupal\field_validation\Plugin\Validation\Constraint\UlidConstraint::validatedBy() must be compatible with Symfony\Component\Validator\Constraint::validatedBy(): string in /builds/issue/ai-3521601/web/modules/contrib/field_validation/src/Plugin/Validation/Constraint/UlidConstraint.php on line 21
This is not relevant to the MR and moreover it is from another module.
With changes in this issue ✨ Pass Search API Server object to AiVdbProvider plugins for more context Active it would be possible to have 1.0.x compatible version with no patches needed.
a.dmitriiev → changed the visibility of the branch 3521601-pass-search-api to hidden.
a.dmitriiev → created an issue.
Fixed in dev versions of 1.x and 2.x
Works as expected. Merging
a.dmitriiev → made their first commit to this issue’s fork.
a.dmitriiev → created an issue.
a.dmitriiev → created an issue.
Merging this in. Thanks for your help.
Waiting for Extra Field Plus to release stable. Extra Field has done beta1 for 3.x.
All the comments were addressed. Please review.
a.dmitriiev → created an issue.
There is the same issue when using Hux → module. +1 for using interface instead.
Changes done in MR for this issue are now included in this issue ✨ Make MD conversion service pluggable Active
Thank you everyone for help, giving credits to all who was involved. Bruno's MR was the first to fix original issue, so it is being merged.
I have checked with the "real" recipe to use the config action to set the backend config and everything worked properly.
As this issue ✨ Add an admin page for module parameters Active was done without taking into account the requirement from this issue, I have implemented the admin UI in MR from this issue with a new properties and new schema.
The MR provides html to markdown converter plugins and plugin manager for it. It is possible to change the default converter in admin UI and also the settings for all converters.
a.dmitriiev → made their first commit to this issue’s fork.
The last comment is for issue ✨ Allow summarize, analyze, suggest title and taxonomy terms based on the rendered HTML of the entity Active
The dialog styles were also adjusted.
I have updated the post update hook, so the plugin is not enabled by default.
MR doesn't have all the changes from patch #58. Now the hook `content_translation_language_fallback_candidates_entity_view_alter` is in the class, so MR actually does not remove it, but patch - does.
I found out that ai.provider
service (class AiProviderPluginManager
) doesn't implement any Interface. Should there be an interface with all the public methods that are custom to this particular plugin manager?
Yes @snehal-chibde, you are right. Thank you for the feedback and finding this bug. I have updated the MR with the fix. Please review again.
baddysonja → credited a.dmitriiev → .
smustgrave you should now have access
I have added the configuration page with a form. As there was only 1 setting in configuration file for enabled entity types, I have added it to the form. Moreover it seems reasonable to add some converter settings, as league/html-to-markdown
is highly configurable. I tried to add all the settings that package supports. I have also injected this new conversion settings into converter service.
Please review MR.
a.dmitriiev → made their first commit to this issue’s fork.
I have created a MR with the following changes:
1. The method getSetProvider
from AiContentSuggestionsPluginBase
class was copied to AiProviderPluginManager
service as it can be used in many other places, not only in the content suggestion plugins. The method is still there in plugin base class but now uses the service internally. This was done for backwards compatibility, so there are no breaking changes as the method was also in the interface.
2. I have added the new configuration setting to "AI Content Suggestions settings" page. This is a system prompt for content suggestion that are attached to the field widget
3. For all string/text fields on "Manage form display" now there is a third party setting from ai_content_suggestions module. This setting allows to generate suggestions per field and paste the result back directly to the field it is attached to. It is possible to use tokens and also entity render tokens from this module
https://www.drupal.org/project/token_entity_render →
for example:
4. In the result on the form you will see the following:
when the field is clicked/focused:
and then when the button is clicked there will be a dialog with suggestions one or mulitple (it depends on the prompt):
when one of the suggestions is clicked, then it is inserted directly into the field. It works for string fields, text fields and also with CKEditor fields.
This will be a game changer I guess, as now a lot of operations will be done with AI and having a place where the prompt can be found easily is very important if you don't know from where to start.
I have a small concern about the storage though. Maybe until it is not too late, it is better to use the content entity? There will be more flexibility, and also the machine name as id will be harder to make unique when the number of prompts will increase with time. And of course with content entity it will be easier to track who and when created/updated the prompt, maybe even have some revisions (as while you are in a search of a good prompt, it could be that you have a couple of tries and maybe it is good idea that you can come back to some nice prompt that was 2-3 attempts before) and of course it would be easier to have some access restrictions. I understand, that this will not allow to easily create prompts on module installation like it can be done with config objects, but there are other ways to provide default content, especially with recipes.
What do you think?
I have refactored a bit the MR and all the plugins, so that they use the base class more, as most of the plugins use the same form elements, so it was easy to generalize the behavior.
a.dmitriiev → made their first commit to this issue’s fork.
I have split main plugin and balloon plugin in the way, that if you want the balloon menu you need to drag a new item to toolbar. This item is invisible. If you don't need it, the behavior will still be the same.
a.dmitriiev → made their first commit to this issue’s fork.
I have update MR with hook_post_update
instead of updating all editor instances in the same hook_update
. I have also noticed that individual plugins do not have schema definition. I have added the config schema for the plugin from this MR, but also added for all existing plugins.
a.dmitriiev → made their first commit to this issue’s fork.
I think as this issue prevents module features from being used, the priority should be raised to "Major", maybe even to "Critical" at some point.
Nothing against Spanish language, but I think for translating into other languages it will be easier with English string.
a.dmitriiev → created an issue.
Uploading the patch, so that it can be easily used in composer projects.
This is also a problem with chat assistant, as the stop sequence setting is displayed and if not set, then empty value is sent. I can confirm that fix from MR works and the request to LLM is successful
Previous patch was corrupted, sorry.
Updated patch, something wrong was with previous one
Uploading the patch also to use in composer based projects.
Uploading the patch, so that it can be used until the stable version is released.
a.dmitriiev → created an issue.
a.dmitriiev → created an issue.
a.dmitriiev → created an issue.
I have also opened a MR for easier collaboration.
I have now another use case:
The AI content suggestions would be nice to have as ajax callback, but the required field of the entity form could be skipped during validation, because for example you want the title to be suggested by AI and it is required.
I have re-rolled the patch for Drupal 11.1.x and removed the change in WidgetBase class, as it might be out of scope. Let's first create the possibility of skipping validation of required fields in general, so that contrib or custom modules can implement this in their code.