How to communicate with the help of API via own Web Interface

Hi there. I am far from programming but have created several Custom GPTs and read a lot of documentation. However, I still cannot understand one very basic thing (at least I think it is basic). I will try to state it here as clearly as possible, but my explanation might still seem very primitive to you.

So, I have the following task before me: I need to have the ability to access one of my Assistants via a web interface from my website. Let’s imagine the interface will look very similar to how Playground currently looks, but with access limited to only the Thread part. The idea is to allow another person to use my Assistant with a given login and password, but through this web interface on my website. I am not asking for details; I will do the necessary work afterward myself. However, what I cannot understand, after spending many days, is what the very general schema (structure) of how to implement this task should be.
What I need, in other words, is for the text input that a person does in the chat window of my webinterface to be copied to my Assistant’s thread, and what the Assistant replies to go back to my webpage interface and appear there in the chat window.
Thank you in advance to those who will offer me any advice.

What you are describing is a client-server application, the client is the web page taking information from the user and passing it to the server to be processed and then receiving data from the server once that processing has been completed and displaying it to the user.

A super simple example of this was created by our very own Logan Kilpatric and can be found here GitHub - logankilpatrick/ChatGPT-Simple: Build a simple locally hosted version of ChatGPT in less than 100 lines of code

This is a simple example of how to call the OpenAI chat API with user input and display the result, this is not the assistants API, but it shows the basic principals you will need to master.

1 Like

If you decide to go with the Chat Completion architecture, this is a flowchart for ONE way to do it:


And, if you’re still interested, a video tutorial: https://www.youtube.com/watch?v=Ix9WIZpArm0&ab_channel=Chatwithdata

But, as mentioned before, this is NOT the Assistants API. It is the ChatCompletion API.

It is my understanding that you can also do what you want to do with the Assistants API.

1 Like