Skip to content

Commit de306e0

Browse files
committed
Deprecate :urlEnv in favor of :url
1 parent 76ae208 commit de306e0

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Support default env values in `${env:MY_ENV:default-value}`.
77
- Deprecate configs:
88
- `systemPromptFile` in favor of `systemPrompt` using `${file:...}` or `${classpath:...}`
9+
- `urlEnv` in favor of `url` using `${env:...}`
910

1011
## 0.83.0
1112

docs/models.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ Schema:
6464
| Option | Type | Description | Required |
6565
|-------------------------------|--------|--------------------------------------------------------------------------------------------------------------|----------|
6666
| `api` | string | The API schema to use (`"openai-responses"`, `"openai-chat"`, or `"anthropic"`) | Yes |
67-
| `urlEnv` | string | Environment variable name containing the API URL | No* |
68-
| `url` | string | Direct API URL (use instead of `urlEnv`) | No* |
67+
| `url` | string | API URL (with support for env like `${env:MY_URL}`) | No* |
6968
| `keyEnv` | string | Environment variable name containing the API key | No* |
7069
| `keyRc` | string | Lookup specification to read the API key from Unix RC [credential files](#credential-file-authentication) | No* |
7170
| `key` | string | Direct API key (use instead of `keyEnv`) | No* |

src/eca/config.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
(def ^:private initial-config*
4242
{:providers {"openai" {:api "openai-responses"
43-
:url "https://api.openai.com"
43+
:url "${env:OPENAI_API_URL:https://api.openai.com}"
4444
:key nil
4545
:keyEnv "OPENAI_API_KEY"
4646
:requiresAuth? true
@@ -53,7 +53,7 @@
5353
"o4-mini" {}
5454
"o3" {}}}
5555
"anthropic" {:api "anthropic"
56-
:url "https://api.anthropic.com"
56+
:url "${env:ANTHROPIC_API_URL:https://api.anthropic.com}"
5757
:key nil
5858
:keyEnv "ANTHROPIC_API_KEY"
5959
:requiresAuth? true
@@ -62,7 +62,7 @@
6262
"claude-opus-4.1" {:modelName "claude-opus-4-1-20250805"}
6363
"claude-haiku-4.5" {:modelName "claude-haiku-4-5-20251001"}}}
6464
"github-copilot" {:api "openai-chat"
65-
:url "https://api.githubcopilot.com"
65+
:url "${env:GITHUB_COPILOT_API_URL:https://api.githubcopilot.com}"
6666
:key nil ;; not supported, requires login auth
6767
:keyEnv nil ;; not supported, requires login auth
6868
:requiresAuth? true
@@ -78,7 +78,7 @@
7878
"grok-code-fast-1" {}
7979
"gemini-2.5-pro" {}}}
8080
"google" {:api "openai-chat"
81-
:url "https://generativelanguage.googleapis.com/v1beta/openai"
81+
:url "${env:GOOGLE_API_URL:https://generativelanguage.googleapis.com/v1beta/openai}"
8282
:key nil
8383
:keyEnv "GOOGLE_API_KEY"
8484
:requiresAuth? true

src/eca/llm_util.clj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
[eca.config :as config]
66
[eca.logger :as logger]
77
[eca.secrets :as secrets]
8-
[eca.shared :as shared])
8+
[eca.shared :as shared]
9+
[camel-snake-kebab.core :as csk])
910
(:import
1011
[java.io BufferedReader]
1112
[java.nio.charset StandardCharsets]
@@ -112,4 +113,6 @@
112113

113114
(defn provider-api-url [provider config]
114115
(or (get-in config [:providers (name provider) :url])
115-
(some-> (get-in config [:providers (name provider) :urlEnv]) config/get-env)))
116+
(config/get-env (str (csk/->SCREAMING_SNAKE_CASE (name provider)) "_API_URL"))
117+
(some-> (get-in config [:providers (name provider) :urlEnv]) config/get-env) ;; legacy
118+
))

0 commit comments

Comments
 (0)