Skip to content

Accumulated PRs #1610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,5 @@ litellm_uuid.txt
.aider*
file.txt
numbers.txt
poetry.lock
poetry.lock
uv.lock
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
A modern command line assistant.

[Documentation](https://docs.openinterpreter.com/) | [Discord](https://discord.gg/Hvz9Axh84z)
NOTICE!
THIS IS A FORK MAINTAINED BY ME, Anton.

Contibuting:
install UV
git clone
cd open-interpreter
uv sync

## Install

Expand Down
34 changes: 18 additions & 16 deletions interpreter/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,24 +186,13 @@ async def async_load_interpreter(args):
async def async_main(args):
global global_interpreter

if args["serve"]:
global_interpreter = await async_load_interpreter(args)
print("Starting server...")
global_interpreter.server()
return

if (
args["input"] is None
and sys.stdin.isatty()
and sys.argv[0].endswith("interpreter")
):
# Display welcome message if appropriate
if (args["input"] is None and sys.stdin.isatty() and sys.argv[0].endswith("interpreter")):
from .misc.welcome import welcome_message

welcome_message()

if args["input"] is None and (
sys.stdin.isatty() and args.get("no_interactive") is not True
):
# Handle interactive terminal mode with concurrent loading
if args["input"] is None and (sys.stdin.isatty() and args.get("no_interactive") is not True):
# Load the interpreter in a separate thread
def load_interpreter_thread(args):
loop = asyncio.new_event_loop()
Expand All @@ -213,17 +202,30 @@ def load_interpreter_thread(args):
thread = threading.Thread(target=load_interpreter_thread, args=(args,))
thread.start()

# Get user input
# Get user input while the interpreter is loading
message = await async_get_input()

# Wait for the thread to finish
thread.join()

# Check if message is a command before processing it
if message.startswith("/"):
print()
parts = message.split(maxsplit=2)
cmd = parts[0].lower()
global_interpreter._handle_command(cmd, parts)
if global_interpreter.interactive:
await global_interpreter.async_chat()
return
else:
# Load interpreter synchronously
spinner = SimpleSpinner()
spinner.start()
global_interpreter = await async_load_interpreter(args)
message = args["input"] if args["input"] is not None else sys.stdin.read()
spinner.stop()

# Process the message
print()
global_interpreter.messages = [{"role": "user", "content": message}]
try:
Expand Down
15 changes: 15 additions & 0 deletions interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,21 @@ def server(self):
# Create and start server
server = Server(self)
try:
host = server.host
port = server.port

print("\n" + "=" * 60)
print(f"Open Interpreter API Server")
print("=" * 60)
print("\nTo use with an OpenAI-compatible client, configure:")
print(f" - API Base: http://{host}:{port}")
print(f" - API Path: /chat/completions")
print(f" - API Key: (any value, authentication not required)")
print(f" - Model name: (any value, ignored)")
print("\nNOTE: The server will use the model configured in --model")
print(f" Currently using: {self.model}")
print("=" * 60 + "\n")

server.run()
except KeyboardInterrupt:
print("\nShutting down server...")
Expand Down
2 changes: 1 addition & 1 deletion interpreter/misc/welcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,6 @@ def welcome_message():
or: interpreter [options]

Documentation: docs.openinterpreter.com
Run 'interpreter --help' for all options
Run 'interpreter --help' for all options or type /help
"""
)
65 changes: 32 additions & 33 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
[tool.poetry]
[project]
name = "open-interpreter"
packages = [
{include = "interpreter"},
{include = "scripts"},
]
version = "1.0.0" # Use "-rc1", "-rc2", etc. for pre-release versions
version = "1.0.0" # Use "-rc1", "-rc2", etc. for pre-release versions
description = "A natural language interface for computers"
authors = ["Killian Lucas <[email protected]>"]
authors = [
{name = "Killian Lucas", email = "[email protected]"},
]
readme = "README.md"
requires-python = ">=3.9,<3.13"
dependencies = [
"litellm>=1.52.3",
"anthropic>=0.39.0",
"pygments>=2.18.0",
"pyautogui>=0.9.54",
"fastapi>=0.115.4",
"prompt-toolkit>=3.0.48",
"pyte>=0.8.2",
"screeninfo>=0.8.1",
"readchar>=4.2.1",
"pillow>=10.3.0",
"uvicorn>=0.32.0",
"pynput>=1.7.7",
"httpx==0.27.2",
"colorama>=0.4.6",
]

[tool.poetry.dependencies]

# Required dependencies
python = ">=3.9,<4"
litellm = "^1.52.3"
anthropic = "^0.39.0"
pygments = "^2.18.0"
pyautogui = "^0.9.54"
fastapi = "^0.115.4"
prompt-toolkit = "^3.0.48"
pyte = "^0.8.2"
screeninfo = "^0.8.1"
readchar = "^4.2.1"
pillow = ">=10.3.0"
uvicorn = "^0.32.0"
pynput = "^1.7.7"
httpx = "0.27.2"
colorama = "^0.4.6"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
[project.scripts]
i = "interpreter.cli:main"
interpreter = "interpreter.cli:main"
interpreter-shell = "scripts.shell:main"
interpreter-uninstall-shell = "scripts.uninstall_shell:main"
wtf = "scripts.wtf:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["interpreter", "scripts"]

[tool.black]
target-version = ['py311']
target-version = ["py311"]

[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
include_trailing_comma = true
Loading