Skip to content
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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
<br><a href="https://0ggfznkwh4j.typeform.com/to/G21i9lJ2">Get early access to the desktop app</a>‎ ‎ |‎ ‎ <a href="https://docs.openinterpreter.com/">Documentation</a><br>
</p>

> [!NOTE]
> **Open Interpreter 1.0** is almost here.
>
> Please help test the [development branch](https://github.com/OpenInterpreter/open-interpreter/tree/development) and share your experience in the [Discord](https://discord.gg/Hvz9Axh84z):
> ```
> pip install git+https://github.com/OpenInterpreter/open-interpreter.git@development
> interpreter --help
> ```

<br>

<img alt="local_explorer" src="https://github.com/OpenInterpreter/open-interpreter/assets/63927363/d941c3b4-b5ad-4642-992c-40edf31e2e7a">
Expand Down
6 changes: 3 additions & 3 deletions interpreter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def print_markdown(message):
# Aesthetic choice. For these tags, they need a space below them
print("")

import pkg_resources
from importlib.metadata import version
import requests
from packaging import version

Expand All @@ -37,8 +37,8 @@ def check_for_update():
response = requests.get(f"https://pypi.org/pypi/open-interpreter/json")
latest_version = response.json()["info"]["version"]

# Get the current version using pkg_resources
current_version = pkg_resources.get_distribution("open-interpreter").version
# Get the current version using importlib.metadata
current_version = version("open-interpreter")

return version.parse(latest_version) > version.parse(current_version)

Expand Down
5 changes: 5 additions & 0 deletions interpreter/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def __init__(
multi_line=True,
contribute_conversation=False,
plain_text_display=False,
reasoning_effort=None, # "minimal" |"low" | "medium" | "high"
):
# State
self.messages = [] if messages is None else messages
Expand Down Expand Up @@ -129,6 +130,10 @@ def __init__(
# LLM
self.llm = Llm(self) if llm is None else llm

# Forward reasoning_effort to LLM
if reasoning_effort is not None and hasattr(self.llm, "reasoning_effort"):
self.llm.reasoning_effort = reasoning_effort

# These are LLM related
self.system_message = system_message
self.custom_instructions = custom_instructions
Expand Down
21 changes: 20 additions & 1 deletion interpreter/core/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, interpreter):

# Settings
self.model = "gpt-4o"
self.temperature = 0
self.temperature = 0.0

self.supports_vision = None # Will try to auto-detect
self.vision_renderer = (
Expand All @@ -73,6 +73,9 @@ def __init__(self, interpreter):
# Budget manager powered by LiteLLM
self.max_budget = None

# Reasoning effort passthrough (providers that support it: e.g., OpenAI o4)
self.reasoning_effort = None # "low" | "medium" | "high"

def run(self, messages):
"""
We're responsible for formatting the call into the llm.completions object,
Expand Down Expand Up @@ -299,6 +302,16 @@ def run(self, messages):
if hasattr(self.interpreter, "conversation_id"):
params["conversation_id"] = self.interpreter.conversation_id

# Forward reasoning effort if set
if self.reasoning_effort:
# OpenAI-compatible shape (e.g., o4)
#params["reasoning"] = {"effort": self.reasoning_effort}
# LiteLLM also accepts flat 'reasoning_effort' for some routes
params["reasoning_effort"] = self.reasoning_effort
# Tell LiteLLM it's allowed to forward these to OpenAI
#params["allowed_openai_params"] = ["reasoning_effort", "reasoning"]
params["allowed_openai_params"] = ["reasoning_effort"]

# Set some params directly on LiteLLM
if self.max_budget:
litellm.max_budget = self.max_budget
Expand Down Expand Up @@ -427,6 +440,12 @@ def fixed_litellm_completions(**params):
litellm.drop_params = (
False # If we don't do this, litellm will drop this param!
)
# preserve custom params for hosted 'i' model (needs conversation_id)
litellm.drop_params = False
#elif any(k in params for k in ("reasoning_effort", "reasoning")):
#elif any(k in params for k in ("reasoning_effort",)):
# keep custom reasoning-related params
#litellm.drop_params = False
else:
litellm.drop_params = True

Expand Down
16 changes: 11 additions & 5 deletions interpreter/core/utils/system_debug_info.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import platform
import subprocess

import pkg_resources
from importlib.metadata import version, PackageNotFoundError
from importlib.metadata import distributions
import psutil
import toml

Expand All @@ -25,8 +26,11 @@ def get_oi_version():
)
except Exception as e:
oi_version_cmd = str(e)
oi_version_pkg = pkg_resources.get_distribution("open-interpreter").version
oi_version = oi_version_cmd, oi_version_pkg
try:
pkg_ver = version("open-interpreter")
except PackageNotFoundError:
pkg_ver = None
oi_version = oi_version_cmd, pkg_ver
return oi_version


Expand All @@ -53,8 +57,10 @@ def get_package_mismatches(file_path="pyproject.toml"):
dev_dependencies = pyproject["tool"]["poetry"]["group"]["dev"]["dependencies"]
dependencies.update(dev_dependencies)

installed_packages = {pkg.key: pkg.version for pkg in pkg_resources.working_set}

installed_packages = {
dist.metadata["Name"].lower(): dist.version
for dist in distributions()
}
mismatches = []
for package, version_info in dependencies.items():
if isinstance(version_info, dict):
Expand Down
6 changes: 2 additions & 4 deletions interpreter/core/utils/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import threading
import uuid

import pkg_resources
from importlib.metadata import version, PackageNotFoundError
import requests


Expand Down Expand Up @@ -47,9 +47,7 @@ def get_or_create_uuid():
def send_telemetry(event_name, properties=None):
if properties is None:
properties = {}
properties["oi_version"] = pkg_resources.get_distribution(
"open-interpreter"
).version
properties["oi_version"] = version("open-interpreter")
try:
url = "https://app.posthog.com/capture"
headers = {"Content-Type": "application/json"}
Expand Down
6 changes: 3 additions & 3 deletions interpreter/terminal_interface/contributing_conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import time
from typing import List, TypedDict

import pkg_resources
from importlib.metadata import version, PackageNotFoundError
import requests

from interpreter.terminal_interface.profiles.profiles import write_key_to_profile
Expand Down Expand Up @@ -173,12 +173,12 @@ def contribute_conversations(
return None

url = "https://api.openinterpreter.com/v0/contribute/"
version = pkg_resources.get_distribution("open-interpreter").version
oi_version = version("open-interpreter")

payload = {
"conversation_id": conversation_id,
"conversations": conversations,
"oi_version": version,
"oi_version": oi_version,
"feedback": feedback,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Images sent to the model will be described with `moondream`. The model will be instructed how to control your mouse and keyboard.
"""

import pkg_resources
from importlib.metadata import version, PackageNotFoundError

REQUIRED_PACKAGES = [
"opencv-python",
Expand All @@ -23,8 +23,8 @@

for package in REQUIRED_PACKAGES:
try:
dist = pkg_resources.get_distribution(package)
except pkg_resources.DistributionNotFound:
dist = version(package)
except PackageNotFoundError:
missing_packages.append(package)

if missing_packages:
Expand Down
6 changes: 3 additions & 3 deletions interpreter/terminal_interface/start_terminal_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import time

import pkg_resources
from importlib.metadata import version, PackageNotFoundError

from interpreter.terminal_interface.contributing_conversations import (
contribute_conversation_launch_logic,
Expand Down Expand Up @@ -409,9 +409,9 @@ def print_help(self, *args, **kwargs):
return

if args.version:
version = pkg_resources.get_distribution("open-interpreter").version
oi_version = version("open-interpreter")
update_name = "Developer Preview" # Change this with each major update
print(f"Open Interpreter {version} {update_name}")
print(f"Open Interpreter {oi_version} {update_name}")
return

if args.no_highlight_active_line:
Expand Down
10 changes: 5 additions & 5 deletions interpreter/terminal_interface/utils/check_for_update.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import pkg_resources
from importlib.metadata import version, PackageNotFoundError
import requests
from packaging import version



def check_for_update():
# Fetch the latest version from the PyPI API
response = requests.get(f"https://pypi.org/pypi/open-interpreter/json")
latest_version = response.json()["info"]["version"]

# Get the current version using pkg_resources
current_version = pkg_resources.get_distribution("open-interpreter").version
# Get the current version using importlib.metadata
current_version = version("open-interpreter")

return version.parse(latest_version) > version.parse(current_version)
return latest_version > current_version
Loading