Skip to content

Commit cc3f00e

Browse files
committed
Merge upstream/main - resolve conflicts in helpers.go and config.go
Conflicts resolved: - helpers.go: merged import sections (io, log, net/http + sync) - config.go: merged AgentDefaults with Schedule, SafetyLevel, BirthYear Upstream features merged: - Config hot reload (PR sipeed#1187) - Anthropic Messages protocol (PR sipeed#1284) - Enhanced Skill Installer v2 (PR sipeed#1252) - Model command CLI (PR sipeed#1250) - ModelScope provider (PR sipeed#1486) - LINE webhook DoS protection (PR sipeed#1413)
2 parents bc70b68 + 9676e51 commit cc3f00e

32 files changed

Lines changed: 3423 additions & 272 deletions

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# ANTHROPIC_API_KEY=sk-ant-xxx
66
# OPENAI_API_KEY=sk-xxx
77
# GEMINI_API_KEY=xxx
8+
# MODELSCOPE_API_KEY=xxx
89
# CLAUDE_CODE_OAUTH=xxx
910
# ── Chat Channel ──────────────────────────
1011
# TELEGRAM_BOT_TOKEN=123456:ABC...

README.fr.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ Cette conception permet également le **support multi-agent** avec une sélectio
985985
| **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - |
986986
| **BytePlus** | `byteplus/` | `https://ark.ap-southeast.bytepluses.com/api/v3` | OpenAI | [Obtenir Clé](https://www.byteplus.com/) |
987987
| **LongCat** | `longcat/` | `https://api.longcat.chat/openai` | OpenAI | [Obtenir une clé](https://longcat.chat/platform) |
988+
| **ModelScope (魔搭)**| `modelscope/` | `https://api-inference.modelscope.cn/v1` | OpenAI | [Obtenir un Token](https://modelscope.cn/my/tokens) |
988989
| **Antigravity** | `antigravity/` | Google Cloud | Custom | OAuth uniquement |
989990
| **GitHub Copilot** | `github-copilot/` | `localhost:4321` | gRPC | - |
990991

@@ -1223,6 +1224,7 @@ Cela se produit lorsqu'une autre instance du bot est en cours d'exécution. Assu
12231224
| **Zhipu** | 200K tokens/mois | Convient aux utilisateurs chinois |
12241225
| **Brave Search** | 2000 requêtes/mois | Fonctionnalité de recherche web |
12251226
| **Groq** | Offre gratuite dispo | Inférence ultra-rapide (Llama, Mixtral) |
1227+
| **ModelScope** | 2000 requêtes/jour | Inférence gratuite (Qwen, GLM, DeepSeek, etc.) |
12261228

12271229
---
12281230

README.ja.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,7 @@ HEARTBEAT_OK 応答 ユーザーが直接結果を受け取る
926926
| **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - |
927927
| **BytePlus** | `byteplus/` | `https://ark.ap-southeast.bytepluses.com/api/v3` | OpenAI | [キーを取得](https://www.byteplus.com) |
928928
| **LongCat** | `longcat/` | `https://api.longcat.chat/openai` | OpenAI | [キーを取得](https://longcat.chat/platform) |
929+
| **ModelScope (魔搭)**| `modelscope/` | `https://api-inference.modelscope.cn/v1` | OpenAI | [トークンを取得](https://modelscope.cn/my/tokens) |
929930
| **Antigravity** | `antigravity/` | Google Cloud | カスタム | OAuthのみ |
930931
| **GitHub Copilot** | `github-copilot/` | `localhost:4321` | gRPC | - |
931932

@@ -1146,6 +1147,7 @@ Web 検索を有効にするには:
11461147
| **Tavily** | 月 1000 クエリ | AI エージェント検索最適化 |
11471148
| **Groq** | 無料枠あり | 高速推論(Llama, Mixtral) |
11481149
| **Cerebras** | 無料枠あり | 高速推論(Llama, Qwen など) |
1150+
| **ModelScope** | 1 日 2000 リクエスト | 無料推論(Qwen, GLM, DeepSeek など) |
11491151

11501152
---
11511153

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,7 @@ This design also enables **multi-agent support** with flexible provider selectio
10411041
| **BytePlus** | `byteplus/` | `https://ark.ap-southeast.bytepluses.com/api/v3` | OpenAI | [Get Key](https://www.byteplus.com) |
10421042
| **Vivgrid** | `vivgrid/` | `https://api.vivgrid.com/v1` | OpenAI | [Get Key](https://vivgrid.com) |
10431043
| **LongCat** | `longcat/` | `https://api.longcat.chat/openai` | OpenAI | [Get Key](https://longcat.chat/platform) |
1044+
| **ModelScope (魔搭)**| `modelscope/` | `https://api-inference.modelscope.cn/v1` | OpenAI | [Get Token](https://modelscope.cn/my/tokens) |
10441045
| **Antigravity** | `antigravity/` | Google Cloud | Custom | OAuth only |
10451046
| **GitHub Copilot** | `github-copilot/` | `localhost:4321` | gRPC | - |
10461047

@@ -1132,6 +1133,26 @@ This design also enables **multi-agent support** with flexible provider selectio
11321133

11331134
> Run `picoclaw auth login --provider anthropic` to paste your API token.
11341135
1136+
**Anthropic Messages API (native format)**
1137+
1138+
For direct Anthropic API access or custom endpoints that only support Anthropic's native message format:
1139+
1140+
```json
1141+
{
1142+
"model_name": "claude-opus-4-6",
1143+
"model": "anthropic-messages/claude-opus-4-6",
1144+
"api_key": "sk-ant-your-key",
1145+
"api_base": "https://api.anthropic.com"
1146+
}
1147+
```
1148+
1149+
> Use `anthropic-messages` protocol when:
1150+
> - Using third-party proxies that only support Anthropic's native `/v1/messages` endpoint (not OpenAI-compatible `/v1/chat/completions`)
1151+
> - Connecting to services like MiniMax, Synthetic that require Anthropic's native message format
1152+
> - The existing `anthropic` protocol returns 404 errors (indicating the endpoint doesn't support OpenAI-compatible format)
1153+
>
1154+
> **Note:** The `anthropic` protocol uses OpenAI-compatible format (`/v1/chat/completions`), while `anthropic-messages` uses Anthropic's native format (`/v1/messages`). Choose based on your endpoint's supported format.
1155+
11351156
**Ollama (local)**
11361157

11371158
```json
@@ -1528,6 +1549,7 @@ This happens when another instance of the bot is running. Make sure only one `pi
15281549
| **Groq** | Free tier available | Fast inference (Llama, Mixtral) |
15291550
| **Cerebras** | Free tier available | Fast inference (Llama, Qwen, etc.) |
15301551
| **LongCat** | Up to 5M tokens/day | Fast inference (free tier) |
1552+
| **ModelScope** | 2000 requests/day | Free inference (Qwen, GLM, DeepSeek, etc.) |
15311553

15321554
---
15331555

README.pt-br.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,7 @@ Este design também possibilita o **suporte multi-agent** com seleção flexíve
981981
| **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - |
982982
| **BytePlus** | `byteplus/` | `https://ark.ap-southeast.bytepluses.com/api/v3` | OpenAI | [Obter Chave](https://www.byteplus.com) |
983983
| **LongCat** | `longcat/` | `https://api.longcat.chat/openai` | OpenAI | [Obter Chave](https://longcat.chat/platform) |
984+
| **ModelScope (魔搭)**| `modelscope/` | `https://api-inference.modelscope.cn/v1` | OpenAI | [Obter Token](https://modelscope.cn/my/tokens) |
984985
| **Antigravity** | `antigravity/` | Google Cloud | Custom | Apenas OAuth |
985986
| **GitHub Copilot** | `github-copilot/` | `localhost:4321` | gRPC | - |
986987

@@ -1220,6 +1221,7 @@ Isso acontece quando outra instância do bot está em execução. Certifique-se
12201221
| **Brave Search** | 2000 consultas/mês | Funcionalidade de busca web |
12211222
| **Groq** | Plano gratuito disponível | Inferência ultra-rápida (Llama, Mixtral) |
12221223
| **Cerebras** | Plano gratuito disponível | Inferência ultra-rápida (Llama 3.3 70B) |
1224+
| **ModelScope** | 2000 requisições/dia | Inferência gratuita (Qwen, GLM, DeepSeek, etc.) |
12231225

12241226
---
12251227

README.vi.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@ Thiết kế này cũng cho phép **hỗ trợ đa tác nhân** với lựa ch
950950
| **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - |
951951
| **BytePlus** | `byteplus/` | `https://ark.ap-southeast.bytepluses.com/api/v3` | OpenAI | [Lấy Khóa](https://www.byteplus.com) |
952952
| **LongCat** | `longcat/` | `https://api.longcat.chat/openai` | OpenAI | [Lấy Key](https://longcat.chat/platform) |
953+
| **ModelScope (魔搭)**| `modelscope/` | `https://api-inference.modelscope.cn/v1` | OpenAI | [Lấy Token](https://modelscope.cn/my/tokens) |
953954
| **Antigravity** | `antigravity/` | Google Cloud | Tùy chỉnh | Chỉ OAuth |
954955
| **GitHub Copilot** | `github-copilot/` | `localhost:4321` | gRPC | - |
955956

@@ -1188,6 +1189,7 @@ Một số nhà cung cấp (như Zhipu) có bộ lọc nội dung nghiêm ngặt
11881189
| **Zhipu** | 200K tokens/tháng | Phù hợp cho người dùng Trung Quốc |
11891190
| **Brave Search** | 2000 truy vấn/tháng | Chức năng tìm kiếm web |
11901191
| **Groq** | Có gói miễn phí | Suy luận siêu nhanh (Llama, Mixtral) |
1192+
| **ModelScope** | 2000 yêu cầu/ngày | Suy luận miễn phí (Qwen, GLM, DeepSeek, v.v.) |
11911193

11921194
---
11931195

README.zh.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ Agent 读取 HEARTBEAT.md
522522
| **神算云** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - |
523523
| **BytePlus** | `byteplus/` | `https://ark.ap-southeast.bytepluses.com/api/v3` | OpenAI | [获取密钥](https://www.byteplus.com) |
524524
| **LongCat** | `longcat/` | `https://api.longcat.chat/openai` | OpenAI | [获取密钥](https://longcat.chat/platform) |
525+
| **ModelScope (魔搭)**| `modelscope/` | `https://api-inference.modelscope.cn/v1` | OpenAI | [获取 Token](https://modelscope.cn/my/tokens) |
525526
| **Antigravity** | `antigravity/` | Google Cloud | 自定义 | 仅 OAuth |
526527
| **GitHub Copilot** | `github-copilot/` | `localhost:4321` | gRPC | - |
527528

@@ -613,6 +614,26 @@ Agent 读取 HEARTBEAT.md
613614

614615
> 运行 `picoclaw auth login --provider anthropic` 来设置 OAuth 凭证。
615616
617+
**Anthropic Messages API(原生格式)**
618+
619+
用于直接访问 Anthropic API 或仅支持 Anthropic 原生消息格式的自定义端点:
620+
621+
```json
622+
{
623+
"model_name": "claude-opus-4-6",
624+
"model": "anthropic-messages/claude-opus-4-6",
625+
"api_key": "sk-ant-your-key",
626+
"api_base": "https://api.anthropic.com"
627+
}
628+
```
629+
630+
> 使用 `anthropic-messages` 协议的场景:
631+
> - 使用仅支持 Anthropic 原生 `/v1/messages` 端点的第三方代理(不支持 OpenAI 兼容的 `/v1/chat/completions`
632+
> - 连接到 MiniMax、Synthetic 等需要 Anthropic 原生消息格式的服务
633+
> - 现有的 `anthropic` 协议返回 404 错误(说明端点不支持 OpenAI 兼容格式)
634+
>
635+
> **注意:** `anthropic` 协议使用 OpenAI 兼容格式(`/v1/chat/completions`),而 `anthropic-messages` 使用 Anthropic 原生格式(`/v1/messages`)。请根据端点支持的格式选择。
636+
616637
**Ollama (本地)**
617638

618639
```json
@@ -901,6 +922,7 @@ Discord: [https://discord.gg/V4sAZ9XWpN](https://discord.gg/V4sAZ9XWpN)
901922
| **Tavily** | 1000 次查询/月 | AI Agent 搜索优化 |
902923
| **Groq** | 提供免费层级 | 极速推理 (Llama, Mixtral) |
903924
| **LongCat** | 最多 5M tokens/天 | 推理速度快 (免费额度) |
925+
| **ModelScope (魔搭)** | 2000 次请求/天 | 免费推理 (Qwen, GLM, DeepSeek 等) |
904926

905927
---
906928

0 commit comments

Comments
 (0)