Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add better docs for safe_mode; load semgrep if available #709

Merged

Conversation

ericrallen
Copy link
Collaborator

Describe the changes you have made:

Update docs for safe_mode, dynamically load semgrep if it's available.

Reference any relevant issue (Fixes #000)

  • I have performed a self-review of my code:

I have tested the code on the following OS:

  • Windows
  • MacOS
  • Linux

AI Language Model (if applicable)

  • GPT4
  • GPT3
  • Llama 7B
  • Llama 13B
  • Llama 34B
  • Huggingface model (Please specify which one)

Install Open Interpreter with the safety toolkit dependencies as part of the bundle:

```shell
pip install open-interpreter[safe]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can leverage the tool.poetry.extras configuration to allow folks to optionally install semgrep and other safety tools via the [safe] extra.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YES. I love this idea.

I think it would be great to make a slimmed down version of OI called [core] (wouldn't even include rich or any terminal interface), [safe] for semgrep, perhaps docker, etc, then eventually [all] if we build features beyond safe mode with dependencies.

interpreter_intro_message.append(f"**Safe Mode**: {interpreter.safe_mode}\n\n>Note: **Safe Mode** requires `semgrep` (`pip install semgrep`)")
if interpreter.safe_mode == "ask" or interpreter.safe_mode == "auto":
if not check_for_package("semgrep"):
interpreter_intro_message.append(f"**Safe Mode**: {interpreter.safe_mode}\n\n>Note: **Safe Mode** requires `semgrep` (`pip install semgrep`)")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we only need to show the semgrep message if it isn't already in the user's current environment. If semgrep is available and safe_mode is enabled, semgrep will be automatically loaded.

@KillianLucas KillianLucas merged commit d588a1d into OpenInterpreter:main Oct 30, 2023
@KillianLucas
Copy link
Collaborator

Great work Eric. Really happy to start seeing [extras] in OI— opens the door to OI serving different kinds of users more precisely.

joshuavial pushed a commit to joshuavial/open-interpreter that referenced this pull request Nov 16, 2023
…afe-mode-docs

chore: add better docs for safe_mode; load semgrep if available
Former-commit-id: d588a1d
Former-commit-id: 52a0e45f954a7492dcbbf298ac1bc8a481edec44
Former-commit-id: 424868a7bcadab255ac122367bb31c8b1898acde [formerly d23999f692e636d257530028f7ddac48c537e4ca]
Former-commit-id: 4013995fcb4278e520468ec2c60e0f6fad008ca2
joshuavial pushed a commit to joshuavial/open-interpreter that referenced this pull request Nov 16, 2023
…afe-mode-docs

chore: add better docs for safe_mode; load semgrep if available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants