Account created on 4 May 2012, almost 13 years ago
#

Merge Requests

More

Recent comments

🇧🇪Belgium lammensj

The one with red line is wrong, in my opinion; it's showing the context of an action within the eca_views.pre_execute-event, but with the data of the eca_render.entity-event. Both logs within the squares start with "Start [event name]... for event eca_views.pre_execute".

🇧🇪Belgium lammensj

Summary of the latest changes:
- [eca_render]: Refactored the way the configuration key is translated to a value (either a token or a regular string)
- [eca_render]: Added update-hook to update existing and their config
- [eca_views]: Added eca_views_set_pagination_values-action to keep the pagination setting across different http-requests. The "issue" mentioned above, with views_infinite_scroll, was not related but did send me in the right direction. Overwriting the pagination via the eca_render_views-action works, but only for the initial rendering. When using ajax pagination, Views falls back to the setting of the View itself.
So I had to tackle this from another angle: hooking into the pre-execute or pre-build event of that View. So I've created a "copy" of the eca_views_set_filter_value-action, and changed it so it sets the pagination- and offset-config.

For my particular use-case (see screenshot) this approach now works: in one model, you render the View and alter it via the pre-build event. There's only one bug, not sure if it is one, and that's data of the event that is available. See separate issue.

🇧🇪Belgium lammensj

I had to create a new MR because the previous one didn't include the necessary changes to the output schema of the ToolsCall-function.

🇧🇪Belgium lammensj

@flyke, this should indeed be fixed in this module. Do you want to create the patch? I believe you already have a system in place where you could test it, right?

🇧🇪Belgium lammensj

@marcus_johansson, the PRs for the related modules are done. Let me know how you want to address this in terms of timing (when I should create new releases etc.).

🇧🇪Belgium lammensj

Yeah, no problem. I should have thought about that when I registered it in the first place... #facepalm

I have some time tonight, I hope I get it done.

🇧🇪Belgium lammensj

It seems to be more complicated than the providers: I made the mistake of registering a contrib module with the same name as the submodule. When the submodule is enabled, and composer downloads the new one, Drupal automatically uses the contrib one, without uninstalling the original. This means you can't run hook_update from the submodule or hook_install from the contrib one.

Perhaps it's easier if I register a new contrib module, something like "ai_integration_eca" and then apply the provided example...

🇧🇪Belgium lammensj

For reference, this is how the Views Block plugin is overriding the items_per_page config item: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/views.... The ECA Action is doing the same thing.

🇧🇪Belgium lammensj

I've implemented your remarks, thank you for the feedback.

Regarding the items being returned for the second "page", I believe it's an issue coming from Views Infinite Scroll. I'll link the ticket. But this shouldn't stop this particular feature request.

🇧🇪Belgium lammensj

Aha, that's very useful, thank you!
I'll take a look and create something similar.

🇧🇪Belgium lammensj

However... Testing the change now... When I set the items per page on the View-object, it works when it's rendered initially. But the second page just loads the amount of items that is configured in the View itself...

🇧🇪Belgium lammensj

It depends a bit on how flexible you want it to be. If you search for "function set" on this page: https://api.drupal.org/api/drupal/core%21modules%21views%21src%21ViewExe..., you'll get a list of all the items you can alter/set before executing the View.

For now, I'm just limiting it to the arguments (already there) and the items per page.

🇧🇪Belgium lammensj

@tijsdeboeck, could you check if the provided solution works for you?

🇧🇪Belgium lammensj

@jurgenhaas, the fix was surprisingly easy! Can you do QA?

🇧🇪Belgium lammensj

@yautja_cetanu, your question regarding the desired schema, that's one for @marcus_johansson, right?

In my opinion, and by my (yet) limited knowledge of the MCP module, I believe a schema needs to be created either way. Whether it's developed for the "separate" implementation of function calling in the AI module, or for MCP, an LLM still needs something that it should adhere to.

To make it more tangible; I'm going to experiment with the Typed Data model I created for the ECA Agent and see how it fits in that MCP plugin type. I believe I can re-use A LOT but just need to split up some things. Like create a separate "tool" for requesting all models, creating a model and editing one. But in the end, the LLM should still generate JSON based on the Schema that I created for the "original" Agent.

I hope this makes sense :)

🇧🇪Belgium lammensj

Hi @socialnicheguru, I'm the maintainer of the standalone contrib module. And yes, it's a duplicate of the submodule, but with extended capabilities (the ECA Agent).
I created/copied it to ensure that the main AI module doesn't need to depend on ECA, because that has its own roadmap with major and minor versions. I'm still in discussion with @marcus_johansson on how we can mark the submodule as deprecated in favor of the contrib one.

🇧🇪Belgium lammensj

I was here (always wanted to write that somewhere :p )

🇧🇪Belgium lammensj

Hi @michaellander, I’m indeed working on an integration for AI, more specifically an AI Agent.
At the moment, it can do 3 things
- Answer questions about existing models and available components (actions, events etc.)
- Create new models
- Edit an existing model
The only thing that’s holding me back of creating a stable release, is one issue where an edit of a model by AI doesn’t result in a valid config item.

Another part are operation types (chat, text_to_image etc.) as Actions.

https://www.drupal.org/project/ai_eca
https://www.drupal.org/project/ai_eca/issues/3481307 📌 Add AI Agent Active

🇧🇪Belgium lammensj

For the ECA agent, I used the Typed Data API and Schemata for generating a JSON Schema that the AI should follow. Once config validation is in core and there's support for Schema-generation, this becomes obsolete.
For non-entity data structures, something like this approach could be beneficial, no?

JSON Schema generation: https://git.drupalcode.org/project/ai_eca/-/merge_requests/1/diffs#288ae...

🇧🇪Belgium lammensj

lammensj made their first commit to this issue’s fork.

🇧🇪Belgium lammensj

@jurgenhaas, I've adjusted the existing kernel test and added a couple of nightwatch tests. You can see the results of the conversion and the auto-layout here: https://git.drupalcode.org/issue/bpmn_io-3484063/-/jobs/3400559/artifacts/browse/web/core/reports/nightwatch/screenshots/Tests/bpmn_io/.

Is there anything else? Do you require more manual testing?

🇧🇪Belgium lammensj

@jurgenhaas, I was able to adjust the Converter and clone the original ECA-entity when it doesn't use the fallback modeller. I'm using the "createDuplicate"-method of the ConfigEntityBase-class. However... The protected $id-property of the ECA-entity doesn't allow null-values, hence the failure in the pipeline. Can this be changed in the ECA-module or should I look for another way of cloning it?

Btw, this can be manually QA'd already, just follow the same steps as above. Just don't forget to temporarily allow null-values for that $id-property.

🇧🇪Belgium lammensj

@jurgenhaas,

1. Do you prefer "convert"? Might capture the intention better... I guess it's a matter of semantics
2. I wasn't aware of the fallback-modeller, so yes, I will definitely make sure that the AI Agent is is generating one that uses that fallback. I wasn't planning on giving the LLM the option to choose.
3. Now that were working towards multiple modellers being able to alter the same ECA-config, the question rises if the admin UI should be altered/optimised? Because you would have multiple rows, concerning the same ECA-config, but different modellers which aren't kept in sync.

🇧🇪Belgium lammensj

Summary

- Added an additional route and controller which preprocesses the given the ECA-config entity and passes certain mappings via drupalSettings to Javascript
- Registered this new route as entity operation of ECA
- Created an additional Javascript class which processes the mapping by creating "Elements" (events, gateways, tasks and conditions) for the root (the Process) and then properly orders them in the BPMN.io-UI

QA

- Use the fork of this module
- Download the package of this ECA-sample: https://ecaguide.org/library/simple/add_role_to_inserted_or_updated_user/
- Unzip it
- Alter the "eca.eca.eca_lib_0007.yml"-file (this the ECA-config file, not the model) by changing the modeller to "core"
- Install the dependencies of this sample (see "dependencies.yml") and the ECA Classic Modeller ( https://www.drupal.org/project/eca_cm )
- Import the altered config file via the UI
- Go to the overview of ECA-models, you should notice that it was added
- On the right, select "Edit with BPMN.io"

TODO

- e2e-test with Nightwatch

🇧🇪Belgium lammensj

Using bpmn-auto-layout is also working! Now for some more testing...

🇧🇪Belgium lammensj

I just got a working POC where I was able to "clone" an existing ECA-config by opening it in the BPMN.io-modeler and use underlying modeler to create the necessary elements and connect them to each other.
Now focussing on the auto-layout... Would be cool to show this on DrupalCamp Berlin :-D

🇧🇪Belgium lammensj

Looking at it further, it might even be that we don't need that cli-plugin but use the modeler-instance directly. See example: https://github.com/bpmn-io/bpmn-js-examples/blob/main/modeling-api/src/snippets/introduction.js

🇧🇪Belgium lammensj

How could I have missed that...

Thank you for the patch!

🇧🇪Belgium lammensj

lammensj created an issue.

🇧🇪Belgium lammensj

Hi @kopeboy,

I'm sorry that the instructions weren't clear enough and that you ran into problems when installing the module.

Your assumption is correct: the drush-command is necessary to initiate the React-loop and to be able to continuously "react" to incoming messages, whether it's via code (event-subscribers) or an ECA-model.
Talking about the example-model, can you ensure that ECA-submodule is enabled as well?

I'll see if can I switch to the release candidate of team-reflex/discord-php:^10. At the moment, that 7.x-version is the only "stable" one.

🇧🇪Belgium lammensj

Thank you for your contribution!

🇧🇪Belgium lammensj

lammensj made their first commit to this issue’s fork.

🇧🇪Belgium lammensj

@wouters_f, I've merged all the work in the original branch you created "3462735-ai-sub-module", together with the latest changes. I've also added a new example flow, based on the flow you created but with the adjusted configuration per action. Would you be able to test it? I don't have access to an OpenAI API key, only Ollama via HuggingFace but that doesn't have support for all operations.

One thing I noticed: the STT-action originally had a "task" config option, for which you could choose between "transcribe" and "translate". Currently, only the OpenAi-provider has support for this operation, but the transcribe-method is hardcoded. @wouters_f, @Marcus_Johansson, any preference on how to deal with this?

Production build 0.71.5 2024