Skip to content

Commit

Permalink
Changed exec.py's Live to update automatically to prevent recursion e…
Browse files Browse the repository at this point in the history
…rror
  • Loading branch information
KillianLucas committed Jul 19, 2023
1 parent 93a9230 commit c0f6824
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ interpreter.reset()

#### Save and Restore Chats

`interpreter.chat()` returns a List of messages, which can be restored with `interpreter.load(messages)`:
`interpreter.chat()` returns a List of messages when return_messages=True, which can be used to resume a conversation with `interpreter.load(messages)`:

```python
messages = interpreter.chat() # Save chat to 'messages'
interpreter.reset() # Reset interpreter
messages = interpreter.chat("My name is Killian.", return_messages=True) # Save messages to 'messages'
interpreter.reset() # Reset interpreter ("Killian" will be forgotten)

interpreter.load(messages) # Resume chat from 'messages'
interpreter.load(messages) # Resume chat from 'messages' ("Killian" will be remembered)
```

#### Customize System Message
Expand Down
Binary file added dist/open_interpreter-0.0.233-py3-none-any.whl
Binary file not shown.
Binary file added dist/open_interpreter-0.0.233.tar.gz
Binary file not shown.
Binary file modified interpreter/__pycache__/exec.cpython-310.pyc
Binary file not shown.
Binary file modified interpreter/__pycache__/interpreter.cpython-310.pyc
Binary file not shown.
Binary file modified interpreter/__pycache__/openai_utils.cpython-310.pyc
Binary file not shown.
Binary file modified interpreter/__pycache__/view.cpython-310.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions interpreter/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def write(self, data):
# None outputs should be empty, they happen with things like plt.show()
if self.data.strip() == "None" or self.data.strip() == "":
self.data = ""
self.live.update("", refresh=True)
self.live.update("")
else:
panel = Panel(self.data.strip(), box=MINIMAL, style="#FFFFFF on #3b3b37")
self.live.update(panel, refresh=True)
self.live.update(panel)

def flush(self):
pass
Expand Down Expand Up @@ -96,7 +96,7 @@ def custom_showtraceback(*args, **kwargs):

code = jupyterify_code(code)

live = Live(console=Console(), auto_refresh=False) # Set auto_refresh to False to update manually
live = Live(console=Console(), refresh_per_second=1) # Set auto_refresh to False to update manually
try:
live.start()
rich_stdout = RichOutStream(live, max_output_chars)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "open-interpreter"
packages = [
{include = "interpreter"}
]
version = "0.0.232"
version = "0.0.233"
description = "Ask GPT-4 to run code locally."
authors = ["Killian Lucas <killian@drinkwater.ai>"]
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: open-interpreter
Version: 0.0.232
Version: 0.0.233
Summary: Ask GPT-4 to run code locally.
Author: Killian Lucas
Author-email: killian@drinkwater.ai
Expand Down Expand Up @@ -149,13 +149,13 @@ interpreter.reset()

#### Save and Restore Chats

`interpreter.chat()` returns a List of messages, which can be restored with `interpreter.load(messages)`:
`interpreter.chat()` returns a List of messages when return_messages=True, which can be used to resume a conversation with `interpreter.load(messages)`:

```python
messages = interpreter.chat() # Save chat to 'messages'
interpreter.reset() # Reset interpreter
messages = interpreter.chat("My name is Killian.", return_messages=True) # Save messages to 'messages'
interpreter.reset() # Reset interpreter ("Killian" will be forgotten)

interpreter.load(messages) # Resume chat from 'messages'
interpreter.load(messages) # Resume chat from 'messages' ("Killian" will be remembered)
```

#### Customize System Message
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter.pth,sha256=thURAWE2FZQ-JjtPEarCJntFrwVZlj-NShFznNWadj8,30
/home/runner/open-interpreter/venv/bin/interpreter,sha256=jh-bUL0vI9B9ZB8tnMA6mUaMSkErmTeNLdqkbZERpr8,137
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter-0.0.232.dist-info/METADATA,sha256=5t08sM74szD5oc928H-BFMLDhl84qaexnleR-GLd6kY,6251
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter-0.0.232.dist-info/INSTALLER,sha256=gcMg69IJ3d31kOPdejOXCeJ_7u2OVE9WaZ5A1idCOi0,6
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter-0.0.232.dist-info/entry_points.txt,sha256=OV1HvxCXDGtVIWpgJ87SNsWbKLkPjbZOfZDKFFBOHs4,48
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter-0.0.232.dist-info/direct_url.json,sha256=2vVEmiUJb_y6SXggZcsmYguZJ2-HG0QzeTW_YgQBiAU,79
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter-0.0.232.dist-info/RECORD,,
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter-0.0.233.dist-info/METADATA,sha256=5O8HvhDgXTHJUk4lSSeFAD6JIyVgqAIm9LHzgyactuU,6406
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter-0.0.233.dist-info/INSTALLER,sha256=gcMg69IJ3d31kOPdejOXCeJ_7u2OVE9WaZ5A1idCOi0,6
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter-0.0.233.dist-info/entry_points.txt,sha256=OV1HvxCXDGtVIWpgJ87SNsWbKLkPjbZOfZDKFFBOHs4,48
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter-0.0.233.dist-info/direct_url.json,sha256=2vVEmiUJb_y6SXggZcsmYguZJ2-HG0QzeTW_YgQBiAU,79
/home/runner/open-interpreter/venv/lib/python3.10/site-packages/open_interpreter-0.0.233.dist-info/RECORD,,

0 comments on commit c0f6824

Please sign in to comment.