Skip to content

Commit 0e09a63

Browse files
authored
Merge pull request #88 from manubot/multiprovider-gh-var-docs
Adds provider, model vars docs to README
2 parents 0094006 + fae16cf commit 0e09a63

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ repos:
3232
hooks:
3333
- id: poetry-check
3434
- repo: https://github.com/tox-dev/pyproject-fmt
35-
rev: "v2.5.1"
35+
rev: "v2.6.0"
3636
hooks:
3737
- id: pyproject-fmt
3838
- repo: https://github.com/rhysd/actionlint

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,25 @@ Start with a manuscript repo [forked from Manubot rootstock](https://github.com/
4040
1. If you haven't already, follow the directions above to create an account and get an API key for your chosen model provider.
4141
1. In your fork's "⚙️ Settings" tab, make a new Actions repository secret with the name `PROVIDER_API_KEY` and paste in your API key as the secret.
4242

43+
If you prefer to select less options when running the workflow, you can optionally set up default values for the model provider and model at either the repo or organization level.
44+
45+
In your fork's "⚙️ Settings" tab, you can optionally create the folllowing Actions repository variables:
46+
- `AI_EDITOR_MODEL_PROVIDER`: Either "openai" or "anthropic"; sets this as the default if "(repo default)" was selected in the workflow parameters.
47+
If this is unspecified and "(repo default)" is selected, the workflow will throw an error.
48+
- `AI_EDITOR_LANGUAGE_MODEL`: For the given provider, what model to use if the "model" field in the workflow parameters was left empty.
49+
If this is unspecified, Manubot AI Editor will select the default model for your chosen provider.
50+
51+
### Multiple Providers
52+
53+
In case you want to use several providers in the same repo, you'll have to register an API key for each provider you intend to use.
54+
Like `PROVIDER_API_KEY`, these keys are also registered as GitHub secrets, and can be specified at either the repository or organizational level.
55+
56+
We currently support the following secrets, with more to follow as we integrate more providers:
57+
- `OPENAI_API_KEY`: the API key for the "openai" provider
58+
- `ANTHROPIC_API_KEY`: the API key for the "anthropic" provider
59+
60+
See [the API key variables docs](https://github.com/manubot/manubot-ai-editor/blob/main/docs/env-vars.md#provider-api-key-configuration) for more information.
61+
4362
### Configuring prompts
4463

4564
In order to revise your manuscript, prompts must be provided to the AI model.
@@ -140,8 +159,7 @@ specific encodings, you can specify the input encoding with the
140159
`AI_EDITOR_SRC_ENCODING` and the output encoding with the
141160
`AI_EDITOR_DST_ENCODING` environment variables.
142161

143-
See
144-
[these variables' help docs](https://github.com/manubot/manubot-ai-editor/blob/main/docs/env-vars.md#encodings)
162+
See[these variables' help docs](https://github.com/manubot/manubot-ai-editor/blob/main/docs/env-vars.md#encodings)
145163
for more information.
146164

147165
Also, see [Python 3 Docs: Standard Encodings](https://docs.python.org/3/library/codecs.html#standard-encodings) for

docs/env-vars.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@ support are "openai" for OpenAI and "anthropic" for Anthropic.
1616

1717
## Provider API Key Configuration
1818

19-
For providers that require API keys, you can specify an API key specific
20-
to that provider via an environment variable named `<PROVIDER>_API_KEY`.
21-
For example, for OpenAI, the API key variable would be named `OPENAI_API_KEY`
22-
and for Anthropic, it would be `ANTHROPIC_API_KEY`.
23-
24-
Alternatively, you can use the environment variable `PROVIDER_API_KEY` to
25-
set an API key that will be used for all providers.
26-
If both a provider-specific key and `PROVIDER_API_KEY` are set, the provider-
27-
specific key will take precedence.
19+
For providers that require API keys, you can specify an API key specific to that provider via an environment variable named `<PROVIDER>_API_KEY`.
20+
For example, for OpenAI, the API key variable would be named `OPENAI_API_KEY` and for Anthropic, it would be `ANTHROPIC_API_KEY`.
21+
22+
Alternatively, you can use the environment variable `PROVIDER_API_KEY` to set an API key that will be used for all providers.
23+
If both a provider-specific key and `PROVIDER_API_KEY` are set, the provider-specific key will take precedence.
2824

2925
## Model Configuration
3026

0 commit comments

Comments
 (0)