Code Monkey home page Code Monkey logo

code-interpreter's Introduction

Sessions Code Interpreter release jupyter python image

A fork of Office AI Image with a custom handler for managing the Jupyter Python Code Interpreter. This project is designed to provide the backend for ACA Sessions Python Code Interpreter.

Getting Started

To get started with this project, you'll need to have Docker installed on your machine. The project is containerized, which means you can easily build and run it in a Docker environment.

Prerequisites

Before you begin, ensure you have the following installed:

Installing

To install and run the project, follow these steps:

  1. Clone the repository to your local machine:
    git clone https://github.com/your-username/code-interpreter.git
    cd code-interpreter
  2. Build container image
    go run make.go containers:BuildCodeInterpreterImage "python"
  3. Run the image:
    go run make.go e2e:RunDockerContainer "6000:6000" "python"

After running these steps, the the interpreter server should be accessible at http://localhost:6000.

Using the APIs

  1. Execute Code - Pass Conditions:

    curl -v -X 'POST' 'http://localhost:6000/execute'   -H 'Content-Type: application/json' -d '{ "code": "1+1" }'
    
     curl -v -X 'POST' 'http://localhost:6000/execute'   -H 'Content-Type: application/json' -d '{ "code": "import time \ntime.sleep(5) \nprint(\"Done Sleeping\")" }'
    
     curl -v -X 'POST' 'http://localhost:6000/execute'   -H 'Content-Type: application/json' -d '{ "code": "print(\"Hello Earth\")" }'
    
     curl -v -X 'POST' 'http://localhost:6000/execute'   -H 'Content-Type: application/json'   -d '{"code": "import matplotlib.pyplot as plt \nimport numpy as np \nx = np.linspace(-2*np.pi, 2*np.pi, 1000) \ny = np.tan(x) \nplt.plot(x, y) \nplt.ylim(-10, 10) \nplt.title('\''Tangent Curve'\'') \nplt.xlabel('\''x'\'') \nplt.ylabel('\''tan(x)'\'') \nplt.grid(True) \nplt.show()"}'
  2. Execute Code - Pass Conditions:

     curl -v -X 'POST' 'http://localhost:6000/execute'   -H 'Content-Type: application/json' -d '{ "code": "printf(\"Hello Earth\")" }'

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

code-interpreter's People

Contributors

ashiquemd avatar shivamkm07 avatar xwang971 avatar pauld-msft avatar sanchitmehta avatar startrightprod[bot] avatar tratcher avatar mdashiquemicrosoft avatar microsoft-github-policy-service[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.