Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tool: Implement E2B's code interpreter #44

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

mlejva
Copy link

@mlejva mlejva commented Apr 25, 2024

Hello Cohere team!

Thank you for this great template! I'm following up with this PR based on the discussion I had with Nick on Twitter.

Description:
This PR adds E2B's code interpretes.
E2B is an open-source secure runtime for AI agents and AI apps. We have a dedicated SDK for code interpreting built on top of our sandboxes. Each sandbox is a micro VM that we can quickly spawn (usually around 900-1.5s). It's like a small computer for AI. The sandbox is made for running untrusted AI-generated code in isolation (it's built on top of Firecracker from AWS).

Dependencies:

Docs, lints, and test:

  • Add docs: Please include testing and documentation for your changes
  • Lint and test: Run make lint and make test

Needed help from the Cohere team:
The E2B code interpreter supports generating and streaming charts. This is achieved byt the code interpreter running a full Jupyter server inside the E2B sandbox.
Here's an example notebook of Llama-3 using our code interpreter for generating charts

My questions:

  1. Do you want to keep the default Python Interpreter tool?
  2. Can you point me to what would be the best way how to send the tool results to frontend outside of the messages stream? I need to send back the charts data and other rich content
  3. Would the MessageContent.tsx component be the best place to implement displaying the charts and other rich content?

Thank you!

@mlejva mlejva requested a review from a team as a code owner April 25, 2024 02:08
@CLAassistant
Copy link

CLAassistant commented Apr 25, 2024

CLA assistant check
All committers have signed the CLA.

@rodrigue-h
Copy link

Thanks for the contribution! Looking into it today.

@elaineg
Copy link
Contributor

elaineg commented Apr 25, 2024

Hi mlejva - we're so excited for your contribution, we're going to create a package for community tools for users to browse and add. Thanks for taking the time to add this! Were you able to get it working in your env?

@mlejva
Copy link
Author

mlejva commented Apr 25, 2024

Hi @elaineg!

Were you able to get it working in your env?

I forgot to add it to LANGCHAIN_TOOLS variable! Sorry, fixed now. Here's a video with the Cohere toolkit + our code interpreter.

Please let me know if you have any other issues with running my PR so I could fix them.


I'd love to get rendering charts working before we merge because that's one of the most powerful features of our code interpreter:

My questions:

  1. Do you want to keep the default Python Interpreter tool?
  2. Can you point me to what would be the best way how to send the tool results to frontend outside of the messages stream? I need to send back the charts data and other rich content
  3. Would the MessageContent.tsx component be the best place to implement displaying the charts and other rich content?

@mlejva
Copy link
Author

mlejva commented Apr 27, 2024

Hi @elaineg @rodrigue-h, is there anything I can help with?

We're demoing Cohere's toolkit with our code interpreter on our developer meetup that we're hosting with LangChain

Here's one of the demos we have prepared. We kind of had to hack together the plot rendering as it wasn't very easy to send the non-message data on the frontend.

@lusmoura
Copy link
Contributor

Hey @mlejva! Sorry it took us so long to get back to you. We just added a new community folder in which we're going to keep all the tools and model deployments added by the community. Do you mind migrating this code to the new folder? The structure should be exactly the same

@mlejva
Copy link
Author

mlejva commented May 3, 2024

Hi @lusmoura super sorry for the late answer, I'll look into it probably Friday and latest over the weekend!

@tianjing-li
Copy link
Collaborator

Hi @mlejva, let us know if you have any further questions regarding the new community folder. You'll also have to sign your commits to allow a merge

@mlejva
Copy link
Author

mlejva commented May 14, 2024

Hi @tianjing-li , I'm sorry I got distracted by bunch of things around running the company. I'm aiming to get this done this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants