refactor: remove VISION_API_KEY/BASE env overrides, all credentials from client config only
register-skill-release / register (push) Successful in 21s
Details
register-skill-release / register (push) Successful in 21s
Details
This commit is contained in:
parent
9d6a15f010
commit
9f381f9bab
17
.env.example
17
.env.example
|
|
@ -5,22 +5,11 @@
|
|||
# 只需在 ~/.openclaw/.env 中配置 CLIENT_KEY:
|
||||
# CLIENT_KEY=sk_xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx
|
||||
#
|
||||
# Vision API key、图搜接口等均通过 auth-rt client-config 自动获取,
|
||||
# 无需在此手动填写。
|
||||
# 所有配置(vision API key、接口地址等)均通过 auth-rt client-config 自动获取。
|
||||
# =============================================================================
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# 可选覆盖(通常不需要)
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# 覆盖 Vision 模型(默认来自 client config,fallback 为 gpt-4o-mini)
|
||||
# VISION_MODEL=gpt-4o-mini
|
||||
|
||||
# 覆盖 Vision API base URL(默认来自 client config metadata.provider.base_url)
|
||||
# VISION_API_BASE=https://your-llm-endpoint/v1
|
||||
|
||||
# 覆盖 Vision API key(默认来自 client config metadata.provider.api_key)
|
||||
# VISION_API_KEY=sk-...
|
||||
# 覆盖 Vision 模型(默认来自 client config,fallback 为 aliyun-cp-multimodal)
|
||||
# VISION_MODEL=aliyun-cp-multimodal
|
||||
|
||||
# 覆盖 auth-rt 二进制路径
|
||||
# AUTH_RT_BIN=/custom/path/to/auth-rt
|
||||
|
|
|
|||
|
|
@ -85,15 +85,13 @@ The only required configuration is `CLIENT_KEY` in `~/.openclaw/.env`:
|
|||
CLIENT_KEY=sk_xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
Everything else — vision API key, image search endpoints — is fetched automatically from the client config via `auth-rt`. No per-skill env vars needed.
|
||||
All credentials and endpoints are fetched automatically from the client config via `auth-rt`. No per-skill env vars needed.
|
||||
|
||||
### Optional overrides
|
||||
|
||||
| Variable | Description |
|
||||
|----------|-------------|
|
||||
| `VISION_MODEL` | Override model name (default: `aliyun-cp-multimodal`) |
|
||||
| `VISION_API_BASE` | Override vision API base URL |
|
||||
| `VISION_API_KEY` | Override vision API key |
|
||||
| `AUTH_RT_BIN` | Override path to the `auth-rt` binary |
|
||||
| `TELEMETRY_ENDPOINT` | POST execution results to a telemetry endpoint |
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ export interface VisionConfig {
|
|||
|
||||
async function loadVisionConfig(client: ReturnType<typeof createSkillClient>): Promise<VisionConfig> {
|
||||
const cfg = await client.clientConfig();
|
||||
const apiKey = cfg.metadata?.provider?.api_key ?? process.env.VISION_API_KEY;
|
||||
const apiKey = cfg.metadata?.provider?.api_key;
|
||||
if (!apiKey) throw new Error('Vision API key not found in client config (metadata.provider.api_key)');
|
||||
return {
|
||||
apiKey,
|
||||
baseURL: cfg.metadata?.provider?.base_url ?? process.env.VISION_API_BASE,
|
||||
baseURL: cfg.metadata?.provider?.base_url,
|
||||
model: process.env.VISION_MODEL ?? cfg.metadata?.provider?.model ?? 'aliyun-cp-multimodal',
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue