e2b-cookbook icon indicating copy to clipboard operation
e2b-cookbook copied to clipboard

docs: Add AI/ML API example

Open D1m7asis opened this issue 6 months ago β€’ 6 comments

πŸ”„ Summary

This PR adds support for AI/ML API, an OpenAI-compatible provider offering 300+ models (e.g., DeepSeek, Gemini, ChatGPT), to the E2B Code Interpreter examples.


βœ… What's Included

  • πŸ§ͺ examples/aimlapi-js/: TypeScript example using E2B sandbox + AI/ML API via OpenAI SDK
  • πŸ§ͺ examples/aimlapi-python/: Python version using openai and e2b-code-interpreter
  • πŸ“Š Uses a CSV dataset to generate and run Python code (e.g., linear regression)
  • πŸ“„ Added .env.template, README.md, and dependency setup for each variant
  • πŸ”— Linked AI/ML API to the providers table in root README.md with proper UTM tracking

Let me know if you'd like the examples styled/formatted differently β€” happy to iterate!

D1m7asis avatar Jun 24 '25 14:06 D1m7asis

Thanks. I will be reviewing this over the weekend.

mishushakov avatar Jul 23 '25 13:07 mishushakov

@mishushakov hi! Can i get a review here pls? Thanks!

D1m7asis avatar Aug 12 '25 08:08 D1m7asis

Hey @mishushakov, thanks for the feedback πŸ™Œ

I’ve fixed the issues: βœ… Handled null content from the API so examples don’t crash on filtered outputs. βœ… Updated both Python and TypeScript examples to use the same flow (two prompts: strawberry count + linear regression with data.csv). βœ… Switched to a recent model (openai/gpt-5-chat-latest) instead of gpt-3.5-turbo. βœ… Verified both examples run fine with the same logic and produce consistent results.

Everything works now and the examples are identical across both languages πŸš€

D1m7asis avatar Aug 18 '25 11:08 D1m7asis

@mishushakov @tizkovatereza hi guys! a reminder to check on the PR :)

OctavianTheI avatar Sep 04 '25 08:09 OctavianTheI

@mishushakov thanks for the review πŸ™Œ Before making the changes, I’d like to check, does e2b have a Slack for integration discussions? If yes, could you please share an invite/connect to [email protected] (Sergey Nuzhny, DevRel + CM at AIMLAPI). We can follow up with more details there if needed.

D1m7asis avatar Sep 10 '25 10:09 D1m7asis

@mishushakov let us know if there is any other changes that need to be implemented Let's wrap this up within 1-2 weeks, and roll out the promo

OctavianTheI avatar Oct 07 '25 10:10 OctavianTheI