-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1427 from OpenInterpreter/development
Documentation and profile updates
- Loading branch information
Showing
17 changed files
with
251 additions
and
22 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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: "FAQ" | ||
description: "Frequently Asked Questions" | ||
--- | ||
|
||
<Accordion title="Does Open Interpreter ensure that my data doesn't leave my computer?"> | ||
As long as you're using a local language model, your messages / personal info | ||
won't leave your computer. If you use a cloud model, we send your messages + | ||
custom instructions to the model. We also have a basic telemetry | ||
[function](https://github.com/OpenInterpreter/open-interpreter/blob/main/interpreter/core/core.py#L167) | ||
(copied over from ChromaDB's telemetry) that anonymously tracks usage. This | ||
only lets us know if a message was sent, includes no PII. OI errors will also | ||
be reported here which includes the exception string. Detailed docs on all | ||
this is [here](/telemetry/telemetry), and you can opt out by running | ||
`--local`, `--offline`, or `--disable_telemetry`. | ||
</Accordion> |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This is a Dockerfile for using an isolated instance of Open Interpreter | ||
|
||
# Start with Python 3.11 | ||
FROM python:3.11 | ||
|
||
# Replace <your_openai_api_key> with your own key | ||
ENV OPENAI_API_KEY <your_openai_api_key> | ||
|
||
# Install Open Interpreter | ||
RUN pip install open-interpreter | ||
|
||
|
||
# To run the container | ||
|
||
# docker build -t openinterpreter . | ||
# docker run -d -it --name interpreter-instance openinterpreter interpreter | ||
# docker attach interpreter-instance | ||
|
||
# To mount a volume | ||
# docker run -d -it -v /path/on/your/host:/path/in/the/container --name interpreter-instance openinterpreter interpreter |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This is all you need to get started | ||
from interpreter import interpreter | ||
|
||
interpreter.chat() |
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 |
---|---|---|
@@ -0,0 +1,119 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Build a local Open Interpreter server for a custom front end" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from flask import Flask, request, jsonify\n", | ||
"from interpreter import interpreter\n", | ||
"import json" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"app = Flask(__name__)\n", | ||
"\n", | ||
"# Configure Open Interpreter\n", | ||
"\n", | ||
"## Local Model\n", | ||
"# interpreter.offline = True\n", | ||
"# interpreter.llm.model = \"ollama/llama3.1\"\n", | ||
"# interpreter.llm.api_base = \"http://localhost:11434\"\n", | ||
"# interpreter.llm.context_window = 4000\n", | ||
"# interpreter.llm.max_tokens = 3000\n", | ||
"# interpreter.auto_run = True\n", | ||
"# interpreter.verbose = True\n", | ||
"\n", | ||
"## Hosted Model\n", | ||
"interpreter.llm.model = \"gpt-4o\"\n", | ||
"interpreter.llm.context_window = 10000\n", | ||
"interpreter.llm.max_tokens = 4096\n", | ||
"interpreter.auto_run = True\n", | ||
"\n", | ||
"# Create an endpoint\n", | ||
"@app.route('/chat', methods=['POST'])\n", | ||
"def chat():\n", | ||
" # Expected payload: {\"prompt\": \"User's message or question\"}\n", | ||
" data = request.json\n", | ||
" prompt = data.get('prompt')\n", | ||
" \n", | ||
" if not prompt:\n", | ||
" return jsonify({\"error\": \"No prompt provided\"}), 400\n", | ||
"\n", | ||
" full_response = \"\"\n", | ||
" try:\n", | ||
" for chunk in interpreter.chat(prompt, stream=True, display=False):\n", | ||
" if isinstance(chunk, dict):\n", | ||
" if chunk.get(\"type\") == \"message\":\n", | ||
" full_response += chunk.get(\"content\", \"\")\n", | ||
" elif isinstance(chunk, str):\n", | ||
" # Attempt to parse the string as JSON\n", | ||
" try:\n", | ||
" json_chunk = json.loads(chunk)\n", | ||
" full_response += json_chunk.get(\"response\", \"\")\n", | ||
" except json.JSONDecodeError:\n", | ||
" # If it's not valid JSON, just add the string\n", | ||
" full_response += chunk\n", | ||
" except Exception as e:\n", | ||
" return jsonify({\"error\": str(e)}), 500\n", | ||
"\n", | ||
" return jsonify({\"response\": full_response.strip()})\n", | ||
"\n", | ||
"if __name__ == '__main__':\n", | ||
" app.run(host='0.0.0.0', port=5001)\n", | ||
"\n", | ||
"print(\"Open Interpreter server is running on http://0.0.0.0:5001\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Make a request to the server" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"curl -X POST http://localhost:5001/chat \\\n", | ||
" -H \"Content-Type: application/json\" \\\n", | ||
" -d '{\"prompt\": \"Hello, how are you?\"}'" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.9" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
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
26 changes: 26 additions & 0 deletions
26
interpreter/terminal_interface/profiles/defaults/bedrock-anthropic.py
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
This is an Open Interpreter profile. It configures Open Interpreter to run Anthropic's `Claude 3 Sonnet` using Bedrock. | ||
""" | ||
|
||
""" | ||
Required pip package: | ||
pip install boto3>=1.28.57 | ||
Required environment variables: | ||
os.environ["AWS_ACCESS_KEY_ID"] = "" # Access key | ||
os.environ["AWS_SECRET_ACCESS_KEY"] = "" # Secret access key | ||
os.environ["AWS_REGION_NAME"] = "" # us-east-1, us-east-2, us-west-1, us-west-2 | ||
More information can be found here: https://docs.litellm.ai/docs/providers/bedrock | ||
""" | ||
|
||
from interpreter import interpreter | ||
|
||
interpreter.llm.model = "bedrock/anthropic.claude-3-sonnet-20240229-v1:0" | ||
|
||
interpreter.computer.import_computer_api = True | ||
|
||
interpreter.llm.supports_functions = True | ||
interpreter.llm.supports_vision = True | ||
interpreter.llm.context_window = 100000 | ||
interpreter.llm.max_tokens = 4096 |
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
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
Oops, something went wrong.