Assistants functions workflow

Hello, can Assistants functions inside the playground (not chatgpt) make direct requests to 3rd party APIs such as google APIs?

Please help me understand the technical workflow process because ChatGPT doesn’t have info on the assistant’s beta API.

I want to create a personal AI browser extension that can create Google Sheets/docs and manipulate the data there by chatting with the AI and I just want to understand the backend workflow.

For example -if I instruct the AI to phrase the relevant information that i want from a big block of text that I will provide for example: John is an engineer, he is from NYC, and his phone number is 12345678.

I want the AI to take the information from the text and send it to Google Sheets and put it in a predefined table that always has Name, Country, Phone. To achieve this, I just want to know one thing, who makes the API calls here to Google Sheets API? my browser extension logic or the assistant’s backend function logic?

I am not a coder, excuse me if my questions are dumb :slight_smile:

So basically the assistant never actually calls any real functions or makes requests to endpoints and such. What you are supposed to do is mock these interactions by defining function schema and feeding them into the assistant as per the function tool documentation here: https://platform.openai.com/docs/assistants/tools/function-calling

When the assistant needs to perform an action, it will call what it thinks is the right function from the pool it was given, and supply input into it as defined by the functions parameters (you can mark which ones are required). The state of the run becomes requires_action when this happens.

What you do is get the name of the function that the assistant has called, and grab the data that it inputted. Then in your program, call the real function of the same name and pass in the data that the assistant gave you. This effectively let’s your program take over and handle the processing. If your real function has output that the assistant is going to need, you can submit it back to the assistant when you have it. In fact you have to. So, if there is no output from your real function, you can always just submit an affirmative like a string that says “success”.

Good luck.

4 Likes