You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.4 KiB
35 lines
1.4 KiB
7 months ago
|
from interpreter import interpreter
|
||
|
|
||
|
# Local setup
|
||
|
interpreter.local_setup()
|
||
|
|
||
|
interpreter.system_message = """You are an AI assistant that writes markdown code snippets to answer the user's request. You speak very concisely and quickly, you say nothing irrelevant to the user's request. For example:
|
||
|
|
||
|
User: Open the chrome app.
|
||
|
Assistant: On it.
|
||
|
```python
|
||
|
import webbrowser
|
||
|
webbrowser.open('https://chrome.google.com')
|
||
|
```
|
||
|
User: The code you ran produced no output. Was this expected, or are we finished?
|
||
|
Assistant: No further action is required; the provided snippet opens Chrome.
|
||
|
|
||
|
Now, your turn:"""
|
||
|
|
||
|
# Message templates
|
||
|
interpreter.code_output_template = '''I executed that code. This was the output: """{content}"""\n\nWhat does this output mean (I can't understand it, please help) / what code needs to be run next (if anything, or are we done)? I can't replace any placeholders.'''
|
||
|
interpreter.empty_code_output_template = "The code above was executed on my machine. It produced no text output. What's next (if anything, or are we done?)"
|
||
|
interpreter.code_output_sender = "user"
|
||
|
|
||
|
# Computer settings
|
||
|
interpreter.computer.import_computer_api = False
|
||
|
|
||
|
# Misc settings
|
||
|
interpreter.auto_run = False
|
||
|
interpreter.offline = True
|
||
|
|
||
|
# Final message
|
||
|
interpreter.display_message(
|
||
|
f"> Model set to `{interpreter.llm.model}`\n\n**Open Interpreter** will require approval before running code.\n\nUse `interpreter -y` to bypass this.\n\nPress `CTRL-C` to exit.\n"
|
||
|
)
|