Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 25, 2024
2 parents 5d3b121 + 6295218 commit cf3a04c
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 35 deletions.
46 changes: 38 additions & 8 deletions docs/settings/all-settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,41 @@
title: All Settings
---

<CardGroup>

<Card
title="Language Model"
icon="robot"
iconType="solid"
href="/settings/all-settings#language-model"
>
Modify the language model and its parameters
</Card>

<Card
title="Interpreter"
icon="circle"
iconType="solid"
href="/settings/all-settings#interpreter"
>
Modify the Interpreter core settings
</Card>
<Card
title="Computer"
icon="desktop"
iconType="solid"
href="/settings/all-settings#computer"
>
Modify the interpreter.computer settings
</Card>

</CardGroup>

# Language Model

### Model Selection

Specifies which language model to use. Check out the [models](/language-models/) section for a list of available models.
Specifies which language model to use. Check out the [models](/language-models/) section for a list of available models. Open Interpreter uses [LiteLLM](https://github.com/BerriAI/litellm) under the hood to support over 100+ models.

<CodeGroup>

Expand All @@ -26,7 +56,7 @@ model: gpt-3.5-turbo
### Temperature
Sets the randomness level of the model's output.
Sets the randomness level of the model's output. The default temperature is 0, you can set it to any value between 0 and 1. The higher the temperature, the more random and creative the output will be.
<CodeGroup>
Expand All @@ -46,7 +76,7 @@ temperature: 0.7
### Context Window
Manually set the context window size in tokens for the model.
Manually set the context window size in tokens for the model. For local models, using a smaller context window will use less RAM, which is more suitable for most devices.
<CodeGroup>
Expand Down Expand Up @@ -126,7 +156,7 @@ api_base: https://api.example.com
### API Key
Set your API key for authentication when making API calls.
Set your API key for authentication when making API calls. For OpenAI models, you can get your API key [here](https://platform.openai.com/api-keys).
<CodeGroup>
Expand Down Expand Up @@ -249,7 +279,7 @@ llm.model: "gpt-4-vision-preview" # Any vision supporting model

### OS Mode

Enables OS mode for multimodal models. Currently not available in Python.
Enables OS mode for multimodal models. Currently not available in Python. Check out more information on OS mode [here](/guides/os-mode).

<CodeGroup>

Expand Down Expand Up @@ -277,7 +307,7 @@ interpreter --version

### Open Profiles Directory

Opens the profiles directory.
Opens the profiles directory. New yaml profile files can be added to this directory.

<CodeGroup>

Expand All @@ -289,7 +319,7 @@ interpreter --profiles

### Select Profile

Select a profile to use.
Select a profile to use. If no profile is specified, the default profile will be used.

<CodeGroup>

Expand Down Expand Up @@ -626,4 +656,4 @@ interpreter.computer.emit_images = True
computer.emit_images: True
```

</CodeGroup>
</CodeGroup>
11 changes: 0 additions & 11 deletions interpreter/terminal_interface/cli.py

This file was deleted.

13 changes: 0 additions & 13 deletions interpreter/terminal_interface/profiles.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions interpreter/terminal_interface/start_terminal_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import pkg_resources

from ..core.core import OpenInterpreter
from .conversation_navigator import conversation_navigator
from .utils.apply_config import apply_config
from .utils.check_for_update import check_for_update
Expand Down Expand Up @@ -689,3 +690,15 @@ def start_terminal_interface(interpreter):
interpreter.in_terminal_interface = True

interpreter.chat()


def main():
interpreter = OpenInterpreter()
try:
start_terminal_interface(interpreter)
except KeyboardInterrupt as e:
print("Interrupted by user:", e)
except Exception as e:
print("An error occurred:", e)
finally:
print("Closing the program.")
35 changes: 35 additions & 0 deletions interpreter/terminal_interface/utils/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import json
import os

import requests
import yaml

from .get_oi_dir import get_oi_dir

config_dir = os.path.join(get_oi_dir() + "configs")


def get_config(filename_or_url):
# i.com/ is a shortcut for openinterpreter.com/profiles/
shortcuts = ["i.com/", "www.i.com/", "https://i.com/", "http://i.com/"]
for shortcut in shortcuts:
if filename_or_url.startswith(shortcut):
filename_or_url = filename_or_url.replace(
shortcut, "openinterpreter.com/profiles/"
)
break

config_path = os.path.join(config_dir, filename_or_url)
if os.path.exists(config_path):
with open(config_path, "r") as file:
try:
return yaml.safe_load(file)
except:
return json.load(file)
else:
response = requests.get(filename_or_url)
response.raise_for_status()
try:
return yaml.safe_load(response.text)
except:
return json.loads(response.text)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ def display_markdown_message(message):
elif line == "---":
rich_print(Rule(style="white"))
else:
rich_print(Markdown(line))
try:
rich_print(Markdown(line))
except UnicodeEncodeError as e:
# Replace the problematic character or handle the error as needed
print("Error displaying line:", line)

if "\n" not in message and message.startswith(">"):
# Aesthetic choice. For these tags, they need a space below them
Expand Down
5 changes: 5 additions & 0 deletions interpreter/terminal_interface/utils/get_oi_dir.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import appdirs


def get_oi_dir():
return appdirs.user_config_dir("Open Interpreter Terminal")
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
interpreter = "interpreter.terminal_interface.cli:main"
i = "interpreter.terminal_interface.cli:main"
interpreter = "interpreter.terminal_interface.start_terminal_interface:main"
i = "interpreter.terminal_interface.start_terminal_interface:main"

[tool.black]
target-version = ['py311']
Expand Down

0 comments on commit cf3a04c

Please sign in to comment.