Computation possibility and handling complex requests in a dashboard context


I’m a computer science student and I’m doing my thesis on OpenAI. The goal is to explore the use of OpenAI services in order to empower the utility of some kind of environmental data in dashboards. I don’t have an AI background and would need some help.

I’m restricting myself to the GPT-3.5 model, as the last GPT-4 model preview was not yet available when I started this project.

The main data source comes from a MySQL DB that is used for a website and many smartphone Apps. Since the DB schema is relatively complex, there are a lot of DB API request methods.

Until now I did some test with the OpenAI API just by modifying the message content value. I didn’t manage to compute an average value from a list (but working with a list with 7 entries). But other tests performed better (search for a word, determine which function is adapted…). A request example can be found below, just in case.

example of computation test request

“messages”: [
“role”: “user”,
“content”: “You are an expert data analyst with a focus on precision. Your task is to calculate the average value of diameters in a dataset by using the mean() method of the python statistics module.
You will get an user request string and a JSON containing data to analyse.
Your response contains only a JSON according to the following format:
“average”: otherId2,
Consider the following dataset structure:
“id”: 3676,
“diameter”: 13.5,


calculate the precise average value of the diameters in the given dataset, ensuring a meticulous analysis.”
“model”: “gpt-3.5-turbo-16k”,
“temperature”: 1,
“top_p”: 1

But now I’m a bit stuck:

  • It would be nice to be able to compute some values. I’m searching a general-purpose solution for any arithmetic or basic statistic computation. Which way would you recommend achieving this goal? Fine-tuning, something like LangChain or is there other solutions? I’m also wondering whether it wouldn’t be a good idea to switch to the last GPT-4 model. I’m indeed asking myself if the code interpreter feature would be suited for computation. I could then give GPT-4 some data, ask him to generate a computation function and to run this function with the input data.

  • There are many possible uses cases, and many aspects has to take into account in the implementation: Display a chart, computation on data and display the output on a chart, determine which data needs to be displayed on the chart axis, filter values on the chart, get the data with DB API requests, searching in the data… The goal would be of course that OpenAI performs as many tasks as possible so I just to need to implement the strict necessary (Display the chart for example). My approach plan would to make use of OpenAI functions call to reduce the complexity of the request handling. A chaining of OpenAI requests would be therefore probably necessary. But I’m not sure if it’s the correct approach. I also thought using embedding and Vector database but It’s still unclear for me how the implementation would look like. How would you solve this?