Skip to content

Commit f4bcbef

Browse files
authored
Merge pull request #1327 from OpenInterpreter/main
Update dev branch
2 parents c065618 + 8ad54e9 commit f4bcbef

File tree

12 files changed

+70
-20
lines changed

12 files changed

+70
-20
lines changed

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
###########################################################################################
2+
# This Dockerfile runs an LMC-compatible websocket server at / on port 8000. #
3+
# To learn more about LMC, visit https://docs.openinterpreter.com/protocols/lmc-messages. #
4+
###########################################################################################
5+
6+
FROM python:3.11.8
7+
8+
# Set environment variables
9+
# ENV OPENAI_API_KEY ...
10+
11+
# Copy required files into container
12+
RUN mkdir -p interpreter
13+
COPY interpreter/ interpreter/
14+
COPY poetry.lock pyproject.toml README.md ./
15+
16+
# Expose port 8000
17+
EXPOSE 8000
18+
19+
# Install server dependencies
20+
RUN pip install -e ".[server]"
21+
22+
# Start the server
23+
ENTRYPOINT ["interpreter", "--server"]

benchmarks/simple.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
This is a sketch of a simple benchmark runner.
3+
"""
4+
5+
tasks = [
6+
{
7+
"question": "",
8+
"answer": "",
9+
},
10+
{"setup_script": "", "question": "", "answer": "", "evaluation_script": ""},
11+
]
12+
13+
# For each task,
14+
# Start a thread that does the following:
15+
# Spin up a docker container
16+
# Run the setup script
17+
# Ask the question
18+
# Run the evaluation script or use an LLM to check the answer

docs/ROADMAP.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
- [ ] Figure out how to get OI to answer to user input requests like python's `input()`. Do we somehow detect a delay in the output..? Is there some universal flag that TUIs emit when they expect user input? Should we do this semantically with embeddings, then ask OI to review it and respond..?
1010
- [ ] Placeholder text that gives a compelling example OI request. Probably use `textual`
1111
- [ ] Everything else `textual` offers, like could we make it easier to select text? Copy paste in and out? Code editing interface?
12+
- [ ] Let people turn off the active line highlighting
13+
- [ ] Add a --plain flag which doesn't use rich, just prints stuff in plain text
14+
- [ ] Use iPython stuff to track the active line, instead of inserting print statements, which makes debugging weird (From ChatGPT: For deeper insights into what's happening behind the scenes, including which line of code is being executed, you can increase the logging level of the IPython kernel. You can configure the kernel's logger to a more verbose setting, which logs each execution request. However, this requires modifying the kernel's startup settings, which might involve changing logging configurations in the IPython kernel source or when launching the kernel.)
1215
- [ ] Let people edit the code OI writes. Could just open it in the user's preferred editor. Simple. [Full description of how to implement this here.](https://github.com/KillianLucas/open-interpreter/pull/830#issuecomment-1854989795)
1316
- [ ] Display images in the terminal interface
1417
- [ ] There should be a function that just renders messages to the terminal, so we can revive conversation navigator, and let people look at their conversations

docs/guides/profiles.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ from interpreter import interpreter
1818
interpreter.os = True
1919
interpreter.llm.supports_vision = True
2020

21-
interpreter.llm.model = "gpt-4-vision-preview"
21+
interpreter.llm.model = "gpt-4o"
2222

23-
interpreter.llm.supports_functions = False
23+
interpreter.llm.supports_functions = True
2424
interpreter.llm.context_window = 110000
2525
interpreter.llm.max_tokens = 4096
2626
interpreter.auto_run = True

docs/settings/all-settings.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,17 @@ llm:
280280

281281
### Vision Mode
282282

283-
Enables vision mode, which adds some special instructions to the prompt and switches to `gpt-4-vision-preview`.
283+
Enables vision mode, which adds some special instructions to the prompt and switches to `gpt-4o`.
284284

285285
<CodeGroup>
286286
```bash Terminal
287287
interpreter --vision
288288
```
289289

290290
```python Python
291-
interpreter.llm.model = "gpt-4-vision-preview" # Any vision supporting model
291+
interpreter.llm.model = "gpt-4o" # Any vision supporting model
292292
interpreter.llm.supports_vision = True
293-
interpreter.llm.supports_functions = False # If model doesn't support functions, which is the case with gpt-4-vision.
293+
interpreter.llm.supports_functions = True
294294
295295
interpreter.custom_instructions = """The user will show you an image of the code you write. You can view images directly.
296296
For HTML: This will be run STATELESSLY. You may NEVER write '<!-- previous code here... --!>' or `<!-- header will go here -->` or anything like that. It is CRITICAL TO NEVER WRITE PLACEHOLDERS. Placeholders will BREAK it. You must write the FULL HTML CODE EVERY TIME. Therefore you cannot write HTML piecemeal—write all the HTML, CSS, and possibly Javascript **in one step, in one code block**. The user will help you review it visually.
@@ -302,10 +302,10 @@ If you use `plt.show()`, the resulting image will be sent to you. However, if yo
302302
loop: True
303303

304304
llm:
305-
model: "gpt-4-vision-preview"
305+
model: "gpt-4o"
306306
temperature: 0
307307
supports_vision: True
308-
supports_functions: False
308+
supports_functions: True
309309
context_window: 110000
310310
max_tokens: 4096
311311
custom_instructions: >

docs/usage/terminal/vision.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ To use vision (highly experimental), run the following command:
88
interpreter --vision
99
```
1010

11-
If a file path to an image is found in your input, it will be loaded into the vision model (`gpt-4-vision-preview` for now).
11+
If a file path to an image is found in your input, it will be loaded into the vision model (`gpt-4o` for now).

interpreter/core/async_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,4 @@ def __init__(self, async_interpreter, host="0.0.0.0", port=8000):
187187
)
188188

189189
def run(self):
190-
uvicorn.run(self.app, host=self.host, port=self.port)
190+
self.uvicorn_server.run()

interpreter/terminal_interface/profiles/defaults/os.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
interpreter.llm.supports_vision = True
77
# interpreter.shrink_images = True # Faster but less accurate
88

9-
interpreter.llm.model = "gpt-4-vision-preview"
9+
interpreter.llm.model = "gpt-4o"
1010

1111
interpreter.computer.import_computer_api = True
1212

13-
interpreter.llm.supports_functions = False
13+
interpreter.llm.supports_functions = True
1414
interpreter.llm.context_window = 110000
1515
interpreter.llm.max_tokens = 4096
1616
interpreter.auto_run = True

interpreter/terminal_interface/profiles/defaults/vision.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
loop: True
44

55
llm:
6-
model: "gpt-4-vision-preview"
6+
model: "gpt-4o"
77
temperature: 0
88
supports_vision: True
9-
supports_functions: False
9+
supports_functions: True
1010
context_window: 110000
1111
max_tokens: 4096
1212
custom_instructions: >

interpreter/terminal_interface/start_terminal_interface.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
contribute_conversations,
1010
)
1111

12-
from ..core.core import OpenInterpreter
1312
from .conversation_navigator import conversation_navigator
1413
from .profiles.profiles import open_storage_dir, profile, reset_profile
1514
from .utils.check_for_update import check_for_update
@@ -320,6 +319,12 @@ def start_terminal_interface(interpreter):
320319

321320
args, unknown_args = parser.parse_known_args()
322321

322+
if args.server:
323+
# Instead use an async interpreter, which has a server. Set settings on that
324+
from interpreter import AsyncInterpreter
325+
326+
interpreter = AsyncInterpreter()
327+
323328
# handle unknown arguments
324329
if unknown_args:
325330
print(f"\nUnrecognized argument(s): {unknown_args}")
@@ -471,14 +476,14 @@ def start_terminal_interface(interpreter):
471476
conversation_navigator(interpreter)
472477
return
473478

474-
if args.server:
475-
interpreter.server()
476-
return
477-
478479
validate_llm_settings(
479480
interpreter
480481
) # This should actually just run interpreter.llm.load() once that's == to validate_llm_settings
481482

483+
if args.server:
484+
interpreter.server.run()
485+
return
486+
482487
interpreter.in_terminal_interface = True
483488

484489
contribute_conversation_launch_logic(interpreter)

0 commit comments

Comments
 (0)