Een hart voor de Drupal Community

Bij make it fly geloven we sterk in Drupal en Open Source software in het algemeen. We maken dagelijks gebruik van vele open source componenten en de vele Drupal modules die beschikbaar zijn. We dragen actief ons steentje bij aan de community door zelf patches, modules en documentatie te voorzien, daarnaast zijn enkele teamleden ook actief in de Drupal User Group vzw.

Een overzicht van onze bijdragen aan de Drupal community vind je terug op onze Drupal.org pagina. Naast het actief meerwerken aan de Drupal community, zetten we ook andere ontwikkelaars op weg door vragen te beantwoorden op Drupal Answers.

  1. Add provider_id context to PostStreamingResponseEvent

    Sven Decabooter

    Problem/Motivation

    Currently, the PostStreamingResponseEvent only contains some basic data regarding output and metadata. It does not store information about which provider ID the post streaming response is coming from, in contrary to \Drupal\ai\Event\PostGenerateResponseEvent, which does provide a getProviderId method.

    For the AI Usage Limits module, and probably others reacting to this event as well, it would be essential information to know which AI provider has triggered this event exactly.

    Proposed resolution

    - Add optional setProviderId() and getProviderId() methods to the event, and make sure implementing logic is able to provide a value for it.

  2. PostStreamingResponseEvent never gets triggered

    Sven Decabooter

    Test PromptJsonDecoderTest seems to fail now, because \Drupal\ai\Event\PostStreamingResponseEvent::__construct doesn't receive a request_thread_id string in its constructor. Not sure if this value is NULL in this test by design, or by accident. If by design, then the PostStreamingResponseEvent $request_thread_id parameter should be allowed to be nullable?

  3. Site Settings Extended

    Randal

    This module provides some different layouts/functionality to the excellent Site Settings module.

    Mainly, a complete overhaul of the layout is added.

    There are two options:

    • Single form
    • Core config pages

    Single form

    The single form layout adds all options in vertical tabs, this can however become quite a big form and is usually only recommended for smaller collections of settings.

    Core config pages

    The core config pages layout uses a page with links like a core config overview page. You can add more information by setting up the "menu_description" view mode, this will be rendered as the description (useful for "multiple" items, for example social links: "facebook", "instagram", ... labels could be rendered as the description). Then you can choose to either open settings in modals or open them in new pages.

    When opening settings forms in modals, you should definitely make use of the patch in the issue linked below, otherwise media library modals will wreck functionality. #2741877: Nested modals don't work

  4. Abstract token usage support

    Sven Decabooter

    Added related issues in AI module, that need to be fixed first, before both token usage for both regular chat and streamed chat can be captured.

  5. Add support for streaming chat token usage

    Sven Decabooter

    Problem/Motivation

    See #3524435: Add token usage to streamed chat. Token usage capturing for streamed chat is being worked on in the AI module. Allow this module to fetch that data for the usage limits.

  6. Add token usage to streamed chat

    Sven Decabooter

    Seems like the failure of PostStreamingResponseEvent not being triggered, is a separate issue. See #3526936: PostStreamingResponseEvent never gets triggered.

    The code in this MR can probably be already reviewed, but will not be functional until this other issue is fixed first.

  7. PostStreamingResponseEvent never gets triggered

    Sven Decabooter

    Problem/Motivation

    This problem came up when working on #3524435: Add token usage to streamed chat.

    The method \Drupal\ai\OperationType\Chat\StreamedChatMessageIterator::triggerEvent() never gets called within the AI module, so the event never gets triggered.

    Perhaps this could be added within each AI provider implementation, but it would be best if the base class could take of this.

    Feedback by Marcus Johansson on Slack regarding this:

    hmm, that is a big bug - this is a little bit of added layers because we didn't set the architecture correct from the start. I will look into if we can run it via the base class when iteration is finished, otherwise we will have to add this task on the providers until 2.0.0

    Steps to reproduce

    - Enable AI CKEditor integration module + AI Provider OpenAI - Add AI button to CKEditor - Enable "Fix spelling" for example - Select a text in CKEditor that needs spelling fixes. - The action gets performed, but the debugger never enters the method `\Drupal\ai\OperationType\Chat\StreamedChatMessageIterator::triggerEvent`

    Proposed resolution

    Feedback by Marcus Johansson:

    __destruct magic method would most likely work to trigger it

  8. Update to config split 2.x for patching capability

    Sven Decabooter

    Thanks for the merge. I guess we can now create followup tickets, so different local sites can request to merge in their own config_split.config_split.la_[LOCAL_SITE].yml and appropriate config/la_[LOCAL_SITE] config split folder.

  9. Add token usage to streamed chat

    Sven Decabooter

    Thanks for the added logic sarvjeetsingh. I am unable to make this work on my local installation though, as mentioned above.

    Test scenario: - Enable AI CKEditor integration module + AI Provider OpenAI - Add AI button to CKEditor - Enable "Fix spelling" for example - Select a text in CKEditor that needs spelling fixes. - The action gets performed, but my debugger never enters the method `\Drupal\ai\OperationType\Chat\StreamedChatMessageIterator::triggerEvent`

  10. Subscribe to AI ProviderDisabledEvent

    Sven Decabooter

    Problem/Motivation

    Subscribe to the ProviderDisabledEvent event provided by AI module. If a provider gets disabled, remove its usage data from the state & clear its config.

  11. Improve config validation

    Sven Decabooter

    Problem/Motivation

    E.g. check if the provider keys provided in `providers` config array are valid AI provider plugin IDs, add explicit config schema definition for each item within the `providers` array, etc...

  12. Improve settings form

    Sven Decabooter

    Problem/Motivation

    Settings form does not use ConfigFormBase or any of the helper logic to manage settings. Fix that.

  13. Abstract token usage support

    Sven Decabooter

    Adding some logic to the MR, in an attempt to also provide support for token usage, in case of streamed responses. This needs https://www.drupal.org/project/ai/issues/3524435 to be fixed first.

Sven Decabooter - Drupal Developer

"Onze teamleden bouwen zelf ook mee aan ons geliefde Drupal, en daar zijn we trots op"

Sven Decabooter
Drupal developer

Betrouwbare technologie, naadloze prestaties. Dat zijn onze Drupal-oplossingen.