Issue with Retrieving Text Response from ChatGPT Vision API

I’m working on integrating the ChatGPT Vision API into my Bubble.io app to generate text based on uploaded images. While the API seems to be called without any errors, I’m having trouble capturing and displaying the generated text within the app. Here’s what I’ve observed:

  • The API is called after an image is uploaded.
  • There are no error messages returned from the API call.
  • I’m uncertain if the integration is fully successful as the expected text output isn’t available.

Here’s an outline of the workflow I try so far:

Step 1: Initiates an API call to process an uploaded image and generate recommendations. [Image upload field’s image]
Step 2: Sets the state of an element on the page to hold the API’s response. I’m using this to temporarily store data returned from the API call. [set custom state of the result of step 1 choice’s first item’s raw body text]
Step 3: Attempts to create a new database entry with the information received from the API’s response. [create a new report = result of step 1 choice’s first item’s raw body text]

Could anyone guide me on how to ensure the API integration is set up correctly and how to retrieve and display the text response from the ChatGPT Vision API in my Bubble.io app?

Any help would be highly appreciated!

First, I would test to confirm that you want the Raw Body Text…usually in API calls you do not want that.

Do something simple with the API connector, and press the re-initalize button or the manual initialize button so you can see all the data fields that are returned by the API call and see which field actually has the value you need.

From my experience working with OpenAI and other APIs the raw body text is likely not what you need and may even be empty.

Thank you for the response.

In the API connector, it works correctly, it provides the output text data in raw data. Could you provide any tips how to go from there?

Im a very beginner with both Bubble and APIs. However, I had successfully done text input - OpenAI - text output, so tried to replicate it here but not everything was possible to replicate, haha.

Would appreciate any tips or links to tutorials that could give an idea. Thanks much!

If so, then when you are in a preview mode of your app, use the debugger to help figure out why the value is not getting set…you can use the step by step to see the workflow actions if they are showing the proper values and also use the inspector tool to see if the data values for specific elements is correct.