How to extract individual fields from OpenAI response

Hello there,

How can I extract individual fields that I can map into HubSpot from an OpenAI response. This is an example:

Thank you.

Hey there!

You need to parse JSON. If you are using a HTTP module there will be a setting called parse JSON. Or you can use the standalone parse JSON module.
Hope that helps - just shoot over any other questions.

Welcome to the Make community!

The OpenAI “Chat Completion” module doesn’t return JSON by default.

Try using the OpenAI “Message an Assistant” module instead:

Send messages to a specified or newly created thread and execute it seamlessly. This action can send the arguments for your function calls to the specified URLs (POST HTTP method only). Works with Assistants v2.

This module allows you to return the parsed JSON as variables, saving you an operation because you don’t have to use the Parse JSON module.

For more information, see the OpenAI page in the Make Help Centre, which covers the following:

  • Connect OpenAI to Make
  • Triggers
  • AI
  • Files
  • Batches

and also,

  • Watch Batch Completed
  • Message an Assistant
  • Create a Completion (Prompt) (GPT and o1, o3 Models)
  • Transform Text to Structured Data
  • Analyze Image(s) - Vision
  • Generate an Image
  • Edit an Image
  • Create a Translation (Whisper)
  • Create a Transcription (Whisper)
  • Create a Moderation
  • Generate an Audio
  • Add Files to a Vector Store
  • Upload a File
  • List Batches
  • Get a Batch
  • Create a Batch
  • Cancel a Batch
  • Make an API Call

You should also take note of the following important details:

  • To use this app, you must have credit in your OpenAI account. You can buy credits on the OpenAI billing page.

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

5 Likes

Thank you so much! I can’t believe I missed this~

2 Likes