installing module gives error

Created on 12 January 2024, 6 months ago
Updated 6 March 2024, 4 months ago

Problem/Motivation

Steps to reproduce

composer require 'drupal/ai_interpolator:^1.0@alpha'

create new field (text formatted long)

Give field name, click save bam:
You also see the error when navigating to the field edit page (if you already created it before.

PHP Fatal error: Declaration of Drupal\ai_interpolator_openai\OpenAiBase::generate(string $prompt, Drupal\Core\Entity\ContentEntityInterface $entity, Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition, array $interpolatorConfig) must be compatible with Drupal\ai_interpolator\Annotation\AiInterpolatorFieldRule::generate(Drupal\Core\Entity\ContentEntityInterface $entity, Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition, array $interpolatorConfig) in web/modules/contrib/ai_interpolator_openai/src/OpenAiBase.php on line 102"

I currently have drupal/openai version 1.0.0-dev

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium wouters_f Leuven

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

Comments & Activities

  • Issue created by @wouters_f
  • πŸ‡ΊπŸ‡ΈUnited States sirkitree

    I was unable to replicate this with a fresh drupal10 install using OSX, colima, ddev
    ```
    ddev composer require 'drupal/ai_interpolator:^1.0@alpha'
    ddev composer require 'drupal/openai:^1.0@beta'
    ddev composer require 'drupal/ai_interpolator_openai:^1.0@alpha'
    ```
    - modified Story content type
    - added new field labeled 'Automated Summary'
    - saved, saved settings on config page

    No errors presented.

    Note that I had not configured the module yet...

    As soon as I put in my OpenAI API key and went to configure the field, I got the following error:
    ```
    Fatal error: Declaration of Drupal\ai_interpolator_openai\OpenAiBase::generate(string $prompt, Drupal\Core\Entity\ContentEntityInterface $entity, Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition, array $interpolatorConfig) must be compatible with Drupal\ai_interpolator\Annotation\AiInterpolatorFieldRule::generate(Drupal\Core\Entity\ContentEntityInterface $entity, Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition, array $interpolatorConfig) in /var/www/html/web/modules/contrib/ai_interpolator_openai/src/OpenAiBase.php on line 102
    ```

  • πŸ‡©πŸ‡ͺGermany Marcus_Johansson

    Hi @wouters_f and thank you for reporting the issue.

    If you use the command
    composer require 'drupal/ai_interpolator_openai:^1.0@alpha'
    without setting minimum-stability to dev it chooses an older Alpha version, where it did not have any requirements to a specific interpolator version. Because its still in Alpha, some API changes are still happening. Alpha2 is probably chosen because it had no dependencies.

    I will be releasing beta releases as soon as some additional tests are written. Before that the module is in experimental mode and is still adding features, so it should not be used in production.

    If you still want to use it, see this link and set it to "dev" and it should get the latest Alpha versions:
    https://getcomposer.org/doc/04-schema.md#minimum-stability

  • πŸ‡ΊπŸ‡ΈUnited States sirkitree

    Can confirm that pulling the dev version worked. I used ddev composer require 'drupal/ai_interpolator_openai:^1.0@dev' rather than modify the composer.json.

  • Status changed to Closed: won't fix 4 months ago
  • πŸ‡©πŸ‡ͺGermany Marcus_Johansson

    I will close this since it was dependency issues in Alpha.

Production build 0.69.0 2024