Skip to main content

๐Ÿค– Building an Interface for OpenAI Assistants API

ยท 3 min read
Jason Hollifield
Founder @ Hollplex

Give OpenAI Assistant Functions access to private networks

I'm going to talk about the OpenAI Assistants API interface I made that you can find here on github.

๐Ÿš€ The Inspiration: OpenAI's Custom GPTs and Assistants APIโ€‹

At the time I had been on the AI hype and messing around with ChatDev, Autogen, AutoGPT and other AI agent software. OpenAi released their Custom GPTs you could make inside ChatGPT and with that they released their Assistants API. The API lets you build custom GPTs essentially and interact with them outside of the ChatGPT website. So you could write programs that use ChatGPT. I wanted to put this API to use but couldn't find any UIs out there already made, so I made one myself.

OpenAI Assistants UI

๐Ÿ› ๏ธ The Approach: Function Calling with AIโ€‹

The Assistants have a function calling feature. Where you can describe a function and the AI will determine when to use said function in its answering process of the prompt you gave it. For example, ChatGPT doesn't have access or the ability to check the uptime of a server on my private network. But I can write a program that has a function that checks the uptime on a server, then tell the AI about this function. Then when I ask the AI about the uptime of a server, it will use the function I told it about to check the uptime of the server.

๐ŸŽฏ Starting with Specific Functionsโ€‹

This is the approach I started out with when creating functions for the AI. The function would do a very specific thing, like check uptime and only check uptime on a server. I then wrote just a generic, run a command on a remote server function. Then let the AI just determine what command to send and it still worked great. I could ask the AI all sorts of questions and it would use the run command function to pass commands to, in order to get data from the server to answer what I prompted it with.

๐ŸŽจ Building the UI with Grimoire GPTโ€‹

The UI interface itself I built mostly through prompting AI. I used the Grimoire GPT that was built as a coding assistant. By simply prompting it for what I wanted to build and then continuing to prompt it for feature additions and fixes, I got to the point where I had a working UI. Grimoire chose the entire stack, python, flask etc. Coding AI assistants aren't perfect today, you still need to know what to ask and how to implement the code returned but it's a great tool to use to get started on a project.

๐Ÿ“š Conclusionโ€‹

I'd like to someday rewrite it since I've learned so much more about web development but for now it serves its purpose. If you have any questions or comments feel free to reach out to me.