'open_ai' config related errors

Created on 16 February 2023, almost 2 years ago

Hello!

Very interesting Drupal module brewing here! Running the latest DEV version of this module (02/16/2023, dev-1.0.x ac739fc) on Ubuntu 22.04 LTS and PHP Version 8.2.3 (initially tried 8.1.16 too), on top of the latest Drupal version 10.0.3. With just a few select OpenAI modules are enabled, on top of an otherwise very light weight D10 development environment, I'm seeing various errors in the logs. After setting the OpenAI config page up with my API Key and Org ID, the OpenAI CKEditor integration works great, but...

Visiting /admin/config/system/article-generation results in:

Uncaught PHP Exception Error: "Class "Drupal\\openai_api\\Controller\\OpenAIApiController" not found" at /data/web/modules/contrib/openai/modules/openai_api/src/Form/ArticleGenerationConfigForm.php line 111,

Visiting /admin/config/system/image-generation results in:

Uncaught PHP Exception Symfony\\Component\\Routing\\Exception\\RouteNotFoundException: "Route "openai_api.api_settings" does not exist." at /data/web/core/lib/Drupal/Core/Routing/RouteProvider.php line 206

While researching this I came across this commit which seemingly changed the naming conventions of the config object, which seems suspiciously related to the above errors. Searching through the current OpenAI 1.x-DEV code base there seems to be references to the OLD naming conventions:

https://git.drupalcode.org/project/openai/-/commit/26271e3980451d6dca1dc...

I've tried updating everything via composer, drush cr, full service restarts, playing with modifying the config object names in the OpenAI module code, and numerous other things along the way I could think of to fix this to no avail. Any thoughts or suggestions for how to resolve these problems would be very much appreciated!

πŸ’¬ Support request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States d0t101101

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

Comments & Activities

  • Issue created by @d0t101101
  • πŸ‡ΊπŸ‡ΈUnited States kevinquillen

    Thanks! Yes, a lot of things are changing rapidly while under development. The "Generator" module does need some work. We began swapping out the homemade client with the third party OpenAI PHP client for development speed and restructuring the modules. I have no doubt there could be some errors with that one module. I can take a look in the next few days and circle back.

  • @kevinquillen opened merge request.
  • Assigned to kevinquillen
  • πŸ‡ΊπŸ‡ΈUnited States kevinquillen

    Okay, I think the content generation has been fixed enough to be usable and demo. I did not touch the image generation, and the Drush command needs a little more tweaking, but it is now functional again. You will need to clear cache and restart your webserver (if using memory cache) because I changed some class names and routes.

  • Status changed to Fixed almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States kevinquillen

    Closing immediate issue, will need to open new tickets on new bugs.

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

    @kevinquillen - thank you very much! Pulled the latest alpha2 and tested - working well over here now (minus the Media/Image generator, as you mentioned, this wasn't 'touched' just yet). Just for reference, filling in the Generators Media 'Image description' results in the following error ATM:

    Error: Call to undefined method OpenAI\Client::getImageUrl() in Drupal\openai_api\Controller\GenerationController->getImageUrlResponseBodyData() (line 112 of /data/web/modules/contrib/openai/modules/openai_api/src/Controller/GenerationController.php).
    
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024