diff --git a/README.md b/README.md index 8ba366c..b22c880 100644 --- a/README.md +++ b/README.md @@ -198,8 +198,6 @@ AWS Bedrock 为新用户提供**最高 $200 免费额度**(注册送 $100 + ### 在 OpenClaw 中配置 AWS Bedrock -#### 方式 A:一键脚本(推荐) - ```bash curl -fsSL https://raw.githubusercontent.com/736773174/openclaw-setup-cn/main/configure-aws-bedrock.sh | bash ``` @@ -211,103 +209,6 @@ curl -fsSL https://raw.githubusercontent.com/736773174/openclaw-setup-cn/main/co - 重启 OpenClaw Gateway - 测试 AWS Bedrock 连接 -#### 方式 B:手动配置 - -**步骤 1:创建环境变量文件** - -创建 `~/.openclaw/.env`: - -```bash -# AWS Bedrock Credentials -export AWS_ACCESS_KEY_ID="你的AccessKeyID" -export AWS_SECRET_ACCESS_KEY="你的SecretAccessKey" -export AWS_REGION="us-west-2" -``` - -**步骤 2:创建 OpenClaw 配置文件** - -创建 `~/.openclaw/openclaw.json`: - -```json -{ - "gateway": { - "mode": "local" - }, - "models": { - "providers": { - "amazon-bedrock": { - "baseUrl": "https://bedrock-runtime.us-west-2.amazonaws.com", - "api": "bedrock-converse-stream", - "auth": "aws-sdk", - "models": [ - { - "id": "global.anthropic.claude-opus-4-6-v1", - "name": "Claude Opus 4.6 (Bedrock)", - "reasoning": true, - "input": ["text", "image"], - "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, - "contextWindow": 200000, - "maxTokens": 8192 - }, - { - "id": "global.anthropic.claude-opus-4-5-20251001-v1:0", - "name": "Claude Opus 4.5 (Bedrock)", - "reasoning": true, - "input": ["text", "image"], - "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, - "contextWindow": 200000, - "maxTokens": 8192 - }, - { - "id": "global.anthropic.claude-sonnet-4-5-20250929-v1:0", - "name": "Claude Sonnet 4.5 (Bedrock)", - "reasoning": true, - "input": ["text", "image"], - "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, - "contextWindow": 200000, - "maxTokens": 8192 - }, - { - "id": "global.anthropic.claude-haiku-4-5-20251001-v1:0", - "name": "Claude Haiku 4.5 (Bedrock)", - "reasoning": false, - "input": ["text", "image"], - "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, - "contextWindow": 200000, - "maxTokens": 8192 - } - ] - } - } - }, - "agents": { - "defaults": { - "model": { - "primary": "amazon-bedrock/global.anthropic.claude-sonnet-4-5-20250929-v1:0" - } - } - } -} -``` - -> **注意**:`baseUrl` 中的区域需要和 `.env` 中的 `AWS_REGION` 一致。费用设为 0 是因为使用 $200 免费额度。 - -**步骤 3:加载环境变量并重启网关** - -```bash -source ~/.openclaw/.env && openclaw gateway restart -``` - -> **建议**:将 `source ~/.openclaw/.env` 添加到 `~/.bashrc` 或 `~/.zshrc`,避免每次手动加载。 - -**步骤 4:验证配置** - -```bash -openclaw agent --session-id test --message "Say OK" --local -``` - -如果配置成功,你应该能看到模型返回 "OK" 的响应。 - ### 可用模型一览 | 模型 | Bedrock Model ID | 推理能力 | 推荐用途 |