diff --git a/.env.example b/.env.example index 50f0f5f..5ea64be 100644 --- a/.env.example +++ b/.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 diff --git a/README.md b/README.md index f8e478e..4c04364 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/src/index.ts b/src/index.ts index 957344a..b5608a2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,11 +16,11 @@ export interface VisionConfig { async function loadVisionConfig(client: ReturnType): Promise { 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', }; }