-
-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2789429
commit 2fbd51c
Showing
15 changed files
with
51 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# CodeInterpreterResponse | ||
|
||
The CodeInterpreterResponse contains the AI agent's response. | ||
|
||
It contains: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,10 @@ | ||
# CodeInterpreterAPI Documentation | ||
# Welcome | ||
|
||
CodeInterpreterAPI is a Python-based API designed give LLM Agents access to python and execute code. It provides a session-based conversational chat interface and the agent framework with a tool for executing code in a secure and isolated environment. | ||
This project provides a LangChain implementation of the ChatGPT Code Interpreter. It allows you to have a back and forth chat with the AI assistant to get it to help with programming tasks, data analysis, and more. You can run everything local except the LLM using your own OpenAI API Key. | ||
|
||
## Key Classes | ||
Some key features: | ||
|
||
### CodeInterpreterSession | ||
|
||
This is the main class that manages a code execution session. It provides methods to start, stop, and check the status of the session. It also handles logging and file uploads for the session. | ||
|
||
#### Methods | ||
|
||
* `from_id(session_id: UUID, **kwargs) -> "CodeInterpreterSession"`: This class method creates a new session from a given UUID. | ||
* `start() -> SessionStatus`: This method starts the session. | ||
* `stop() -> SessionStatus`: This method stops the session. | ||
* `log(msg: str) -> None`: This method logs a message. | ||
|
||
### CodeBox | ||
|
||
This class represents the code execution environment. It provides methods to upload files, execute code, and check the status of the execution. For more information look into the codebox api documentation. | ||
|
||
## Usage | ||
|
||
To use this API, create a new `CodeInterpreterSession` and use the `start` method to start the session. You can then use the `generate_response_sync` method to generate an AI response and the `stop` method to stop the session. You can use the generate response method multiple times in a single session to have a conversation with the AI. | ||
|
||
## Contributing | ||
|
||
Contributions are welcome. Please make sure to write functional Python with full type hinting and only write needed and precise comments. | ||
|
||
(This file was half chatgpt generated and not complete - real docs coming soon!) | ||
TODO: Write real docs | ||
- Sandboxed execution of Python code snippets provided by the AI assistant using CodeBox. CodeBox is the simplest cloud infrastructure for your LLM Apps. | ||
- Automatic handling of file uploads/downloads | ||
- Support for stateful conversations with chat history | ||
- Extensible architecture to add custom tools and logic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Analyzing the Iris Dataset | ||
|
||
```python | ||
from codeinterpreterapi import CodeInterpreterSession, File | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Using the Streamlit Webapp | ||
|
||
The streamlit webapp allows interacting with the API through a GUI: | ||
|
||
```bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Usage | ||
|
||
To create a session and generate a response: | ||
|
||
```python | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# UserRequest | ||
|
||
The UserRequest class represents the user input to the agent. | ||
|
||
It contains: | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters