API for Advanced Data Analytics

Formerly known as Code Interpreter. I am wonder if Advanced Data Analytics will be part of the OpenAI API or will it be a ChatGPT Plugin only? I’m not sure I have a use case for it now, but the idea is that chat context windows are only going to get us so far and I’m curious where Advanced Data Analytics is headed. Thanks in advance.

5 Likes

You can prompt a code that provides the solution.

E.g. when you want to read a PDF you can just do this (this code is pretty old, I was using the old text-davinci-003 model here)

#!/usr/bin/env bash
set -x

# when you run the script you give it a filename $1 and ghostscript creates a tiff from the pdf
gs -sDEVICE=tiffg4 -o "output.tiff" "$1"

# and tesseract creates a hocr file
tesseract "output.tiff" "test" -l eng --psm 6 hocr

# and yaml needs less memory
yaml=$(xml2yaml test.hocr)

## Create an key here: https://beta.openai.com/account/api-keys
export OPENAI_API_KEY=''

## AI Model
model=text-davinci-003

# I bet you can make a better prompt - this is just a 15 second thing
request="write a python script that gives me some insights on this data: \n\n ${yaml}"

hocrprompt="${request//$'\n'/ }"
hocrprompt="${hocrprompt//\\n/ }"
hocrprompt="${hocrprompt//\'/ }"
hocrprompt="${hocrprompt//\"/ }"


response=$(curl -s https://api.openai.com/v1/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d "{\"model\": \"$model\", \"prompt\": \"${hocrprompt}\", \"temperature\": 0.5, \"max_tokens\": 1024}")

echo ${hocrprompt} | jq . >> ~/.openai-gpt-3-history
echo ";\n\n\n\n"  >> ~/.openai-gpt-3-history

echo "$response" | jq . >> ~/.openai-gpt-3-history
echo ";\n\n\n\n"  >> ~/.openai-gpt-3-history

echo "$response" | jq -r .choices[0].text

And then you can just run the python script on a secured container…

2 Likes

The new name should have been “python notebook sandbox function”.

Because that is what it is and does. A function call like other function calling. The AI told it will get the return value it specifies when it writes code and sends it to the function.

1 Like

I think they nailed the name for the right audience. What I might forsee is a use case driven by APIs vs chat which would benefit me in not building, running, and maintaining the “python notebook sandbox function” which to me is valuable.

I believe it’s “Advanced Data Analysis” as opposed to “Analytics”, but the name is dry as toast either way.

My guess is that OpenAI is being a bit cautious with Code Interpreter / Adv. Data An. because of how agentic and autonomous it is capable of acting. If it had an API endpoint, one could theoretically wire it to a more capable runtime environment and give it internet access, and they’re not ready for the bad press when CI/ADA goes out and rug pulls people with an NFC scam, or buys peoples credit card numbers off of the dark web.

@_j Think this might be of interest to you? GitHub - OpenInterpreter/open-interpreter: A natural language interface for computers

with open("interpreter/forbidden_commands.json", "r") as f:
  forbidden_commands = json.load(f)

Errr… really?

Why not a docker container with a linked directory and some docker execs?

Would even be way better in terms of how many languages that would enable.

Not sure I understand? Is that a comment/issue for the OS project?

Hey @metaskills, you might find useful E2B’s AI Playgrounds - e2b.dev/docs

I’m a co-founder of E2B - we’re building cloud for AI Agents. You can use our AI Playground’s SDK to create your own personal code interpreter.

Happy to help you set everything up! Feel free to ping me here on on Twitter (mlejva)

1 Like

Is this the same thing as what’s currently there?