@@ -23,9 +23,16 @@ please submit a pull request if you've tested it.
2323## API Key
2424
2525This requires an [ API token from OpenAI] [ token ] . The plugin checks for the API
26- key in two ways (in this order).
26+ key in three ways (in this order).
2727
28- First, it checks the environment variable ` OPENAI_API_KEY ` , which you can set
28+ First, it tries to read the key from Binary Ninja's preferences. You can
29+ access the entry in Binary Ninja via ` Edit > Preferences > Settings > OpenAI ` .
30+ Or, use the hotkey ⌘+, and search for ` OpenAI ` . You should see customizable
31+ settings like so.
32+
33+ ![ Settings] ( ./resources/settings.png )
34+
35+ Second, it checks the environment variable ` OPENAI_API_KEY ` , which you can set
2936inside of Binary Ninja's Python console like so:
3037
3138``` python
@@ -42,8 +49,8 @@ mkdir ~/.openai
4249echo -n " INSERT KEY HERE" > ~ /.openai/api_key.txt
4350```
4451
45- Note that if you have both set, the plugin defaults to the environment variable.
46- If your API token is invalid, you'll receive the following error:
52+ Note that if you have all three set, the plugin defaults to one set in Binary
53+ Ninja. If your API token is invalid, you'll receive the following error:
4754
4855``` python
4956openai.error.AuthenticationError: Incorrect API key provided: < BAD KEY HERE > .
@@ -69,7 +76,9 @@ The output will appear in Binary Ninja's Log like so:
6976## OpenAI Model
7077
7178By default, the plugin uses the ` text-davinci-003 ` model, you can tweak this
72- inside of [ entry.py] [ entry ] .
79+ inside Binary Ninja's preferences. You can access these settings as described in
80+ the [ API Key] ( #api-key ) section. It uses the maximum available number of tokens
81+ for each model, as described in [ OpenAI's documentation] [ tokens ] .
7382
7483## Known Issues
7584
@@ -86,6 +95,7 @@ This project is licensed under the [MIT license][license].
8695
8796[ default-plugin-dir ] :https://docs.binary.ninja/guide/plugins.html
8897[ token ] :https://beta.openai.com/account/api-keys
98+ [ tokens ] :https://beta.openai.com/docs/models/gpt-3
8999[ entry ] :./src/entry.py
90100[ asyncio ] :https://docs.python.org/3/library/asyncio.html
91101[ issue-8 ] :https://github.com/WhatTheFuzz/binaryninja-openai/issues/8
0 commit comments