I looking to generate analytics or basic bi based on user-asking questions and provided data. I’m currently converting the data into a dictionary or df format to send to api. How can I use the GPT-4 (Code Interpreter) API to provide accurate BI responses.
I have one idea is to use the API to generate Matplotlib python code for visualization, but I’m unsure about the response implementation and costing. Any insights or other suggestions ?
Have you by chance tried Advanced Data Analysis through something like ChatGPT first? I think the tool you’re building already exists.
Code interpreter should work much the same way as data analysis. You can actually feed it data while requesting to perform some action on said data (like displaying it as a graph), and it should build & run code that displays your request. At least for Data Analysis. There might be some things you’d have to apply manually if performing on code interpreter, but the principles are much the same.
What I am implying is i know Gpt 4 can produce data visualization on giving data but can it give through api. What I am familiar with is that api can give only textual responses. That’s why I was suggesting is to get back python code based on user questions, data and use it in bot application to generate visual
Hi, I am currently using azure open ai gpt 4 api it comes with code Interpreter, in application code
messages = [
{‘role’: ‘system’, ‘content’: system_message},
{‘role’: ‘user’, ‘content’: f"{user_message}"}
]
response = openai.ChatCompletion.create()
return response.choices[0].message[“content”]
Here what I need is that gpt 4 use code Interpreter and response with basic analytics only then we can display it on the web that.
Hi, did you get any solution for this problem. I am also stuck on the same problem. I am using gpt-4 turbo preview but it cannot generate plots or visualizations. Do you find any solution for that