{"id":13407341,"url":"https://github.com/shroominic/codeinterpreter-api","last_synced_at":"2025-05-12T15:21:51.121Z","repository":{"id":180113588,"uuid":"664427248","full_name":"shroominic/codeinterpreter-api","owner":"shroominic","description":"👾 Open source implementation of the ChatGPT Code Interpreter","archived":false,"fork":false,"pushed_at":"2024-11-07T03:28:33.000Z","size":1297,"stargazers_count":3844,"open_issues_count":66,"forks_count":405,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-04-23T17:13:41.184Z","etag":null,"topics":["chatgpt","chatgpt-code-generation","code-interpreter","codeinterpreter","langchain","llm-agent"],"latest_commit_sha":null,"homepage":"https://discord.gg/Vaq25XJvvW","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shroominic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"roadmap.todo","authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"shroominic","patreon":null,"open_collective":null,"ko_fi":"shroominic","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-07-10T00:20:41.000Z","updated_at":"2025-04-23T12:42:30.000Z","dependencies_parsed_at":"2023-12-12T11:25:29.577Z","dependency_job_id":"44d6d3d6-188e-4353-bca0-2abf429f48c8","html_url":"https://github.com/shroominic/codeinterpreter-api","commit_stats":{"total_commits":273,"total_committers":24,"mean_commits":11.375,"dds":"0.22710622710622708","last_synced_commit":"9482d36f32841a1ffd641db67f772bad1fc622b7"},"previous_names":["shroominic/codeinterpreter-api"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shroominic%2Fcodeinterpreter-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shroominic%2Fcodeinterpreter-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shroominic%2Fcodeinterpreter-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shroominic%2Fcodeinterpreter-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shroominic","download_url":"https://codeload.github.com/shroominic/codeinterpreter-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250477810,"owners_count":21437049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","chatgpt-code-generation","code-interpreter","codeinterpreter","langchain","llm-agent"],"created_at":"2024-07-30T20:00:38.148Z","updated_at":"2025-04-23T17:13:46.253Z","avatar_url":"https://github.com/shroominic.png","language":"Python","readme":"# 👾 Code Interpreter API\n\n[![Version](https://badge.fury.io/py/codeinterpreterapi.svg)](https://badge.fury.io/py/codeinterpreterapi)\n![Downloads](https://img.shields.io/pypi/dm/codeinterpreterapi)\n![License](https://img.shields.io/pypi/l/codeinterpreterapi)\n![PyVersion](https://img.shields.io/pypi/pyversions/codeinterpreterapi)\n\nA [LangChain](https://github.com/langchain-ai/langchain) implementation of the ChatGPT Code Interpreter.\nUsing CodeBoxes as backend for sandboxed python code execution.\n[CodeBox](https://github.com/shroominic/codebox-api/tree/main) is the simplest cloud infrastructure for your LLM Apps.\nYou can run everything local except the LLM using your own OpenAI API Key.\n\n## Features\n\n- Dataset Analysis, Stock Charting, Image Manipulation, ....\n- Internet access and auto Python package installation\n- Input `text + files` -\u003e Receive `text + files`\n- Conversation Memory: respond based on previous inputs\n- Run everything local except the OpenAI API (OpenOrca or others maybe soon)\n- Use CodeBox API for easy scaling in production\n\n## Docs\n\nCheckout the [documentation](https://shroominic.github.io/codeinterpreter-api/) for more information.\n\n## Installation\n\nGet your OpenAI API Key [here](https://platform.openai.com/account/api-keys) and install the package.\n\n```bash\npip install \"codeinterpreterapi[all]\"\n```\n\nEverything for local experiments are installed with the `all` extra.\nFor deployments, you can use `pip install codeinterpreterapi` instead which does not install the additional dependencies.\n\n## Usage\n\nTo configure OpenAI and Azure OpenAI, ensure that you set the appropriate environment variables (or use a .env file):\n\nFor OpenAI, set the OPENAI_API_KEY environment variable:\n\n```bash\nexport OPENAI_API_KEY=sk-**********\n```\n\n```python\nfrom codeinterpreterapi import CodeInterpreterSession, settings\n\n\n# create a session and close it automatically\nwith CodeInterpreterSession() as session:\n    # generate a response based on user input\n    response = session.generate_response(\n        \"Plot the bitcoin chart of year 2023\"\n    )\n    # output the response\n    response.show()\n```\n\n![Bitcoin YTD](https://github.com/shroominic/codeinterpreter-api/blob/main/examples/assets/bitcoin_chart.png?raw=true)\nBitcoin YTD Chart Output\n\n## Dataset Analysis\n\n```python\nfrom codeinterpreterapi import CodeInterpreterSession, File\n\n# this example uses async but normal sync like above works too\nasync def main():\n    # context manager for auto start/stop of the session\n    async with CodeInterpreterSession() as session:\n        # define the user request\n        user_request = \"Analyze this dataset and plot something interesting about it.\"\n        files = [\n            # attach files to the request\n            File.from_path(\"examples/assets/iris.csv\"),\n        ]\n\n        # generate the response\n        response = await session.generate_response(\n            user_request, files=files\n        )\n\n        # output to the user\n        print(\"AI: \", response.content)\n        for file in response.files:\n            # iterate over the files (display if image)\n            file.show_image()\n\n\nif __name__ == \"__main__\":\n    import asyncio\n\n    asyncio.run(main())\n```\n\n![Iris Dataset Analysis](https://github.com/shroominic/codeinterpreter-api/blob/main/examples/assets/iris_analysis.png?raw=true)\nIris Dataset Analysis Output\n\n## Production\n\nIn case you want to deploy to production, you can utilize the CodeBox API for seamless scalability.\n\nPlease contact me if you are interested in this, as it is still in the early stages of development.\n\n## Contributing\n\nThere are some remaining TODOs in the code.\nSo, if you want to contribute, feel free to do so.\nYou can also suggest new features. Code refactoring is also welcome.\nJust open an issue or pull request and I will review it.\n\nPlease also submit any bugs you find as an issue with a minimal code example or screenshot.\nThis helps me a lot in improving the code.\n\n## Contact\n\nYou can contact me at [contact@shroominic.com](mailto:contact@shroominic.com).\nBut I prefer to use [Twitter](https://twitter.com/shroominic) or [Discord](https://discord.gg/Vaq25XJvvW) DMs.\n\n## Support this project\n\nIf you would like to help this project with a donation, you can [click here](https://ko-fi.com/shroominic).\nThanks, this helps a lot! ❤️\n","funding_links":["https://github.com/sponsors/shroominic","https://ko-fi.com/shroominic"],"categories":["Libraries","Python","开源项目","A01_文本生成_文本对话","Agent Integration \u0026 Deployment Tools","🤖 ChatGPT Agents","Reimplementations","Repos","Open Source Projects","SDK, Libraries, Frameworks"],"sub_categories":["其他聊天机器人","大语言对话模型及数据","LLM Framework Tools","Development \u0026 Coding","Other / Chatbots","Python library, sdk or frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshroominic%2Fcodeinterpreter-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshroominic%2Fcodeinterpreter-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshroominic%2Fcodeinterpreter-api/lists"}