codeinterpreter-api icon indicating copy to clipboard operation
codeinterpreter-api copied to clipboard

Possibly a JavaScript package?

Open salvinoto opened this issue 2 years ago • 5 comments

I’d like to integrate something like this into my next JS project. Would it be worthwhile for me to at least attempt to rewrite this code, or should I setup something like a flask server and do it with API calls?

salvinoto avatar Jul 23 '23 12:07 salvinoto

It's hard to start a jupyter kernel in the frontend so you need a cloud-hosted solution. This is what CodeBox is for (beta release in the next few days). But even with the CodeBox API, you need to make sure the API-Key is stored in a backend because otherwise it will get leaked and this would be expensive. It's currently not possible to create such an application without a backend so the only working idea would be to release a JS Backend solution. I am not a lot into JS so this task seems a bit hard for me but maybe someone else can work on this. The current best solution, for now, would be to use a Python Backend like FastAPI/Flask or Django :)

shroominic avatar Jul 23 '23 15:07 shroominic

In case you want to implement the CodeBox API to your JS Backend you could do it using the pure REST API. You can check out how this works here: https://codeboxapi.com/docs

shroominic avatar Jul 23 '23 15:07 shroominic

In case you want to implement the CodeBox API to your JS Backend you could do it using the pure REST API.

You can check out how this works here: https://codeboxapi.com/docs

So correct me if I’m wrong, but codebox is your solution to host something like this on its own? Meaning I can use codebox to run the interpreter and just make API calls to it? I assume I’d have to give codebox my OpenAI key?

salvinoto avatar Jul 24 '23 01:07 salvinoto

No, the OpenAI calls are not passed through the CodeBox. Only the Python code execution is done inside the CodeBox with the given files. You can look up the code its open source :)

shroominic avatar Jul 24 '23 11:07 shroominic

No, the OpenAI calls are not passed through the CodeBox. Only the Python code execution is done inside the CodeBox with the given files. You can look up the code its open source :)

Ah okay thank you! I think I understand now.

salvinoto avatar Jul 24 '23 11:07 salvinoto