You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(action): support any LLM provider via llm_provider input
The action hardcoded OPENROUTER_API_KEY + an OpenRouter-only preflight, so a
user with an OpenAI/Anthropic/etc. key couldn't use it. Add an optional
'llm_provider' input that maps the key to the engine's env var by the
<NAME>_API_KEY convention (with aws_bedrock/ollama exceptions); the engine then
auto-selects the provider. Gate the OpenRouter preflight and the 'openrouter/'
model-prefix guard behind provider==openrouter, export only the selected env
var in both engine steps, and add llm_provider to the base-cache key. Default
stays openrouter, so existing workflows are unchanged. No engine change.
Copy file name to clipboardExpand all lines: action.yml
+57-40Lines changed: 57 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,12 @@ branding:
8
8
9
9
inputs:
10
10
llm_api_key:
11
-
description: 'LLM API key (OpenRouter by default). Required.'
11
+
description: 'Your LLM provider API key (see llm_provider). Required.'
12
12
required: true
13
+
llm_provider:
14
+
description: 'Provider for llm_api_key. The key is handed to the engine as that provider''s env var (anthropic -> ANTHROPIC_API_KEY, openai -> OPENAI_API_KEY, ...; aws_bedrock -> AWS_BEARER_TOKEN_BEDROCK, ollama -> OLLAMA_BASE_URL) and the engine auto-selects it. Default openrouter.'
15
+
required: false
16
+
default: 'openrouter'
13
17
github_token:
14
18
description: 'GITHUB_TOKEN used to post the PR comment. Defaults to the workflow token.'
15
19
required: false
@@ -245,6 +249,7 @@ runs:
245
249
shell: bash
246
250
env:
247
251
RAW_KEY: ${{ inputs.llm_api_key }}
252
+
RAW_PROVIDER: ${{ inputs.llm_provider }}
248
253
RAW_AGENT_MODEL: ${{ inputs.agent_model }}
249
254
RAW_PARSING_MODEL: ${{ inputs.parsing_model }}
250
255
run: |
@@ -254,49 +259,56 @@ runs:
254
259
echo "::error::llm_api_key is empty. On fork PRs, repo secrets are withheld by GitHub."
255
260
exit 1
256
261
fi
257
-
# Pasting a key into the secret UI often picks up trailing newlines,
258
-
# wrapping quotes, or a whole `KEY=value` line. Normalize all of that.
262
+
# Resolve the provider -> the env var the engine reads. Convention is
263
+
# <NAME>_API_KEY; two providers don't follow it. The engine is the source
264
+
# of truth: an unknown provider just yields an env var it won't recognize,
265
+
# and the engine errors with the list of valid keys.
0 commit comments