Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
johannr-dev committed Feb 24, 2024
1 parent fd4f7a0 commit e37bf59
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,34 @@

![Animated GIF](https://github.com/wunderwuzzi23/blog/raw/master/static/images/2023/yolo-shell-anim-gif.gif)

# Update Yolo v0.3 - Support for Azure OpenAI

* Key changes are upgrades to the latest OpenAI libraries and support for Azure OpenAI. There is an `api` key in the `yolo.yaml` that can be set to `azure_openai` and then you can provide all the parameters accordingly in the yaml file as well (`api-version`, your `azure-endpoint`,...). The api key for azure is called `AZURE_OPENAI_API_KEY` by the way. It can be set via environment variable and config file.
* It's now possible to change the color of the suggested command via config file
* The "modify prompt" feature is now optional and can be toggled via config file.
* Minor bug fixes (like copy to clipboard should work on macOS)

Tested on macOS and Linux. Windows hopefully still works also.

# Update Yolo v0.2 - Support for GPT-4 API

This update introduces the `yolo.yaml` configuration file. In this file you can specify which OpenAI model you want to query, and other settings. The safety switch also moved into this configuration file.

For now the default model is still `gpt-3.5-turbo`, but you can update to `gpt-4` if you have gotten access already!

```
Yolo v0.2 - by @wunderwuzzi23
Yolo v0.3 - by @wunderwuzzi23
Usage: yolo [-a] list the current directory information
Argument: -a: Prompt the user before running the command (only useful when safety is off)
Current configuration per yolo.yaml:
* Model : gpt-3.5-turbo
* API : openai
* Model : gpt-4-turbo-preview
* Temperature : 0
* Max. Tokens : 500
* Safety : on
* Safety : True
* Command Color: blue
```

Happy Hacking!
Expand All @@ -41,7 +52,13 @@ yolo show me some funny unicode characters
There are three ways to configure the key on Linux and macOS:
- You can either `export OPENAI_API_KEY=<yourkey>`, or have a `.env` file in the same directory as `yolo.py` with `OPENAI_API_KEY="<yourkey>"` as a line
- Create a file at `~/.openai.apikey` with the key in it
- Add the key to the `yolo.yaml` configuration file
- Set the key in the `yolo.yaml` configuration file

### Azure OpenAI Key configuration
There are three ways to configure the key on Linux and macOS:
- You can either `export AZURE_OPENAI_API_KEY=<yourkey>`, or have a `.env` file in the same directory as `yolo.py` with `AZURE_OPENAI_API_KEY="<yourkey>"` as a line
- Create a file at `~/.azureopenai.apikey` with the key in it
- Set the key in the `yolo.yaml` configuration file

## Aliases

Expand Down Expand Up @@ -83,6 +100,8 @@ On Windows `export OPENAI_API_KEY=<yourkey>` will not work instead:

Optionally (since v.0.2), the key can also be stored in `yolo.yaml`.

If you want to use Azure, the the key is called `AZURE_OPENAI_API_KEY`.

## Running yolo on Windows

Windows is less tested, it does work though and will use PowerShell.
Expand Down
2 changes: 2 additions & 0 deletions yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ def print_usage(config):
print()

print("Current configuration per yolo.yaml:")
print("* API : " + str(config["api"]))
print("* Model : " + str(config["model"]))
print("* Temperature : " + str(config["temperature"]))
print("* Max. Tokens : " + str(config["max_tokens"]))
print("* Safety : " + str(bool(config["safety"])))
print("* Command Color: " + str(config["suggested_command_color"]))


def get_os_friendly_name():
Expand Down

0 comments on commit e37bf59

Please sign in to comment.