
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
CodeInterpreterAPI is an (unofficial) open source python interface for the ChatGPT CodeInterpreter.
A LangChain implementation of the ChatGPT Code Interpreter. Using CodeBoxes as backend for sandboxed python code execution. CodeBox is the simplest cloud infrastructure for your LLM Apps. You can run everything local except the LLM using your own OpenAI API Key.
text + files
-> Receive text + files
Checkout the documentation for more information.
Get your OpenAI API Key here and install the package.
pip install "codeinterpreterapi[all]"
Everything for local experiments are installed with the all
extra.
For deployments, you can use pip install codeinterpreterapi
instead which does not install the additional dependencies.
To configure OpenAI and Azure OpenAI, ensure that you set the appropriate environment variables (or use a .env file):
For OpenAI, set the OPENAI_API_KEY environment variable:
export OPENAI_API_KEY=sk-**********
from codeinterpreterapi import CodeInterpreterSession, settings
# create a session and close it automatically
with CodeInterpreterSession() as session:
# generate a response based on user input
response = session.generate_response(
"Plot the bitcoin chart of year 2023"
)
# output the response
response.show()
Bitcoin YTD Chart Output
from codeinterpreterapi import CodeInterpreterSession, File
# this example uses async but normal sync like above works too
async def main():
# context manager for auto start/stop of the session
async with CodeInterpreterSession() as session:
# define the user request
user_request = "Analyze this dataset and plot something interesting about it."
files = [
# attach files to the request
File.from_path("examples/assets/iris.csv"),
]
# generate the response
response = await session.generate_response(
user_request, files=files
)
# output to the user
print("AI: ", response.content)
for file in response.files:
# iterate over the files (display if image)
file.show_image()
if __name__ == "__main__":
import asyncio
asyncio.run(main())
Iris Dataset Analysis Output
In case you want to deploy to production, you can utilize the CodeBox API for seamless scalability.
Please contact me if you are interested in this, as it is still in the early stages of development.
There are some remaining TODOs in the code. So, if you want to contribute, feel free to do so. You can also suggest new features. Code refactoring is also welcome. Just open an issue or pull request and I will review it.
Please also submit any bugs you find as an issue with a minimal code example or screenshot. This helps me a lot in improving the code.
You can contact me at contact@shroominic.com. But I prefer to use Twitter or Discord DMs.
If you would like to help this project with a donation, you can click here. Thanks, this helps a lot! ❤️
FAQs
CodeInterpreterAPI is an (unofficial) open source python interface for the ChatGPT CodeInterpreter.
We found that codeinterpreterapi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.