Error Message on OpenAI Prompt

Created on 31 May 2023, about 1 year ago

Problem/Motivation

When attempting to use the OpenAI Prompt screen, after entering in known, valid api information, the screen does not show a response.

Checking the Drupal Log, I see this message:
Location: .../admin/config/openai/openai-prompt?_wrapper_format=drupal_ajax&ajax_form=1

Referrer: .../admin/config/openai/openai-prompt

OpenAI\Exceptions\ErrorException: in OpenAI\Transporters\HttpTransporter->requestObject() (line 66 of .../vendor/openai-php/client/src/Transporters/HttpTransporter.php).

Steps to reproduce

  • Install module, enter api key.
  • Navigate to Prompt Explorer (/admin/config/openai/openai-prompt), enter a text for prompt, click submit.
  • No response displayed.
  • Check Drupal Log for messages.
πŸ› Bug report
Status

Fixed

Version

1.0

Component

OpenAI Prompt

Created by

πŸ‡ΊπŸ‡ΈUnited States edwardmonk

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

Comments & Activities

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

    I am unable to replicate. Unfortunately without an exception error string, I only have a few guesses...

    • Is the API key entered the API key, or the org id? Some have mixed these up.
    • Does your account have a credit card on file?
    • Is the OpenAI network service having issues today?
  • πŸ‡ΊπŸ‡ΈUnited States edwardmonk

    Thinking about this comment:
    "Is the API key entered the API key, or the org id? Some have mixed these up."

    I went to the OpenAI API "Organization settings" and copied the Organization ID (as opposed to the the Name) and pasted that into the "Organization name/ID" field at /admin/config/openai/settings

    Tested the Prompt page again and it worked fine. Changed it back to the Organization name and it failed again. So, it seems that the Organization Name does not work on this install.

    Thanks!

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

    The organization id is not the same as the organization name. It itself looks similar to the API key. While not explicitly required by the API, someday it may be.

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

    I can confirm that just putting nothing in the "Organization name/ID" on the OpenAI Settings page also works fine. So, in summary, using the Organizational causes the reported error on this install, but entering the Organizational ID or nothing, works fine.

    Thank you for your assistance.

  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States kevinquillen
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024