nextcloud / integration_openai

OpenAI integration in Nextcloud
GNU Affero General Public License v3.0
51 stars 11 forks source link

[LocalAI] Image generation fails due to malformed API Key #138

Open XueSheng-GIT opened 1 day ago

XueSheng-GIT commented 1 day ago

Which version of integration_openai are you using?

3.1.2

Which version of Nextcloud are you using?

NC 30.0.1 RC1

Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.

Ubuntu Firefox 131

Describe the Bug

Image generation fails with error `OpenAI/LocalAI's text to image generation failed with: Client error:

GET http://my.domain.lan:8080/generated-images/b641846089601.png` resulted in a `403 Forbidden` response:\nmissing or malformed API Key

Log:

{"reqId":"rkfezxHpaE2osZCqTNIf","level":3,"time":"2024-10-09T10:52:20+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Unknown error while processing TaskProcessing task","userAgent":"--","version":"30.0.1.0","exception":{"Exception":"RuntimeException","Message":"OpenAI/LocalAI's text to image generation failed with: Client error: `GET http://my.domain.lan:8080/generated-images/b641846089601.png` resulted in a `403 Forbidden` response:\nmissing or malformed API Key\n","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/TaskProcessing/Manager.php","line":810,"function":"process","class":"OCA\\OpenAi\\TaskProcessing\\TextToImageProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/TaskProcessing/SynchronousBackgroundJob.php","line":54,"function":"processTask","class":"OC\\TaskProcessing\\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OC\\TaskProcessing\\SynchronousBackgroundJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php","line":43,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php","line":29,"function":"start","class":"OCP\\BackgroundJob\\QueuedJob","type":"->"},{"file":"/var/www/nextcloud/core/Command/Background/JobWorker.php","line":129,"function":"execute","class":"OCP\\BackgroundJob\\QueuedJob","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OC\\Core\\Command\\Background\\JobWorker","type":"->"},{"file":"/var/www/nextcloud/core/Command/Base.php","line":161,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"OC\\Core\\Command\\Base","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":171,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":183,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":87,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/integration_openai/lib/TaskProcessing/TextToImageProvider.php","Line":151,"message":"Unknown error while processing TaskProcessing task","exception":[],"CustomMessage":"Unknown error while processing TaskProcessing task"},"id":"67064459be93a"}

Expected Behavior

API_KEY should be transmitted correctly so that image will be shown as result.

To Reproduce

  1. Start AI Assistant
  2. Select Generate image
  3. Add text to "Describe the image..."
  4. Press Generate image button
  5. Processing modal appears while LocalAI is generating the image
kyteinsky commented 21 hours ago

hi, would you mind some questions?

  1. what provider are you using as the backend? And the version of the backend service?
  2. which authentication method are you using, api_key?
XueSheng-GIT commented 21 hours ago

hi, would you mind some questions?

1. what provider are you using as the backend? And the version of the backend service?

2. which authentication method are you using, api_key?
  1. Provider/Backend: localAI docker (localai/localai:v2.21.0-aio-cpu) with stablediffusion
  2. Authentication: API_KEY