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

Add custom copilot with local code interpreter #29

Merged
merged 9 commits into from
Dec 18, 2024
Merged

Conversation

mnicstruwig
Copy link
Collaborator

This PR adds an example custom copilot that makes use of a local code interpreter to write / execute code to answer the user's query.

It supports chart and tabular artifact output (by way of the OpenBB app integration).

The code interpreter is implemented in the Python standard lib, and spins up a separate process that uses a modified InteractiveConsole to execute code and capture output. We need to use a modified InteractiveConsole to capture both outputs from print statements, and also evaluated expressions (like a normal REPL would do), since GPT-4o seems to have been fine-tuned on interacting with a REPL, where the last expression is evaluated and returned.

The code interpreter was used as a workshop for the GAIN lecture that I was asked to do on the 14th of December 2024.

@montezdesousa
Copy link
Contributor

do you expect the chart to be on the status update?

image

Copy link
Contributor

@montezdesousa montezdesousa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'd just add an example on how to leverage the code interpreter through the chat interface

@mnicstruwig mnicstruwig merged commit 991c903 into main Dec 18, 2024
5 checks passed
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.

3 participants