Assistant API (from OpenAI) block configuration

Hi,

I have searched and read all relevant posts plus excessively searched elsewhere on the internet. To my knowledge, there is yet to be a published answer to this challenge.

For context: The OpenAI block works great - but it is only for the default OpenAI. The two big updates from OpenAI of the last year are Custom GPTs and Assistant API. The former is not relevant as it does not operate outside of OpenAI. The latter is very relevant as it is the only way to offer access to a customised version of ChatGPT to app users - it’s a big deal.

What I’m asking is for the variation needed to have Thunkable connect with an Assistant API.

The first should be to use the Web API block (not OpenAI block).

From there, how should we incorporate the key elements of Assistant API calls?

These are:

  1. Secret Key
  2. Assistant ID
  3. " Calls to the Assistants API require that you pass a beta HTTP header. This is handled automatically if you’re using OpenAI’s official Python or Node.js SDKs."
OpenAI-Beta: assistants=v2

I would, and I’m sure many other OpenAI users, be very grateful for a support thread that offers how to make an Assistant API call with with Thunkable.

Many thanks

This is a pretty good guide to get you started @carlfdunckeri:

On the OpenAI side, if you want to connect to their Assistant API, do they provide any Swagger documentation or guides for connecting via something like Postman that you could use to get started configuring this in your Thunkable app?

My request: Add an “assistantId” parameter to the OpenAI_Service.TextCompletion block. The default could be null which would mean the regular “frontier” call to OpenAI. But if the coder specifies an assistantid, the block will prompt that restricted set of info.

OpenAI lets you set up assistants in their UI. I can create one andadd some files to it Prompts sent to it use the document set to answer (mostly). For instance, I’ve got one for my Thunkable book so students can ask the book questions.

It would be a huge addition and reasonably easy to implement for Thunkable team (I apologize in advance for saying that)