[PR #27] [MERGED] Claude侧支持客户端请求体中的model #102

Closed
opened 2026-02-27 01:56:14 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ErlichLiu/DeepClaude/pull/27
Author: @GowayLee
Created: 2/8/2025
Status: Merged
Merged: 2/16/2025
Merged by: @ErlichLiu

Base: mainHead: dynamic_model_id


📝 Commits (7)

  • 90efdcc feat: base_client增加timeout设置
  • e5d2608 refactor: 删除剩余deepseek provider残留
  • c633040 feat: Claude模型支持使用请求体中的模型id
  • b98077e docs: 更新.env.example,添加动态Claude模型说明
  • 0fc715b Merge branch 'main' into dynamic_model_id
  • 7751be3 Merge branch 'ErlichLiu:main' into dynamic_model_id
  • f05d0e4 refactor: optimize safety and format

📊 Changes

6 files changed (+353 additions, -186 deletions)

View changed files

📝 .env.example (+4 -1)
📝 app/clients/base_client.py (+74 -22)
📝 app/clients/claude_client.py (+51 -27)
📝 app/clients/deepseek_client.py (+50 -27)
📝 app/deepclaude/deepclaude.py (+104 -65)
📝 app/main.py (+70 -44)

📄 Description

主要更改

Claude侧模型支持使用客户端请求体中定义的model #23

更改说明

1. main.py

读取请求体中的model字段, 如果为空则默认赋值为claude-3-5-sonnet. 判断环境变量ENV_CLAUDE_MODEL是否为空字符串, 若是, 则使用请求体中的model作为claude model进行请求.

优先级:

环境变量 -> 请求体model字段 -> 默认值"claude-3-5-sonnet"

2. .env.example

增加CLAUDE_MODEL变量说明.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ErlichLiu/DeepClaude/pull/27 **Author:** [@GowayLee](https://github.com/GowayLee) **Created:** 2/8/2025 **Status:** ✅ Merged **Merged:** 2/16/2025 **Merged by:** [@ErlichLiu](https://github.com/ErlichLiu) **Base:** `main` ← **Head:** `dynamic_model_id` --- ### 📝 Commits (7) - [`90efdcc`](https://github.com/ErlichLiu/DeepClaude/commit/90efdccc6d03f5245c4c40dc808e2a6abbc74a45) feat: base_client增加timeout设置 - [`e5d2608`](https://github.com/ErlichLiu/DeepClaude/commit/e5d2608b1b003a5583a93a5faed9a4922285c8db) refactor: 删除剩余deepseek provider残留 - [`c633040`](https://github.com/ErlichLiu/DeepClaude/commit/c63304097e62d67279d8070645aa52ffa1c37e81) feat: Claude模型支持使用请求体中的模型id - [`b98077e`](https://github.com/ErlichLiu/DeepClaude/commit/b98077e9065d7be0878c81fbbe516e60b4b1c843) docs: 更新.env.example,添加动态Claude模型说明 - [`0fc715b`](https://github.com/ErlichLiu/DeepClaude/commit/0fc715b3b7574d8e6f648d7c810ee9868f9d1047) Merge branch 'main' into dynamic_model_id - [`7751be3`](https://github.com/ErlichLiu/DeepClaude/commit/7751be32112bfa774f016788f9b8cb8731d67115) Merge branch 'ErlichLiu:main' into dynamic_model_id - [`f05d0e4`](https://github.com/ErlichLiu/DeepClaude/commit/f05d0e4abf36b7525c9dbca5f70b82299c8e2daf) refactor: optimize safety and format ### 📊 Changes **6 files changed** (+353 additions, -186 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+4 -1) 📝 `app/clients/base_client.py` (+74 -22) 📝 `app/clients/claude_client.py` (+51 -27) 📝 `app/clients/deepseek_client.py` (+50 -27) 📝 `app/deepclaude/deepclaude.py` (+104 -65) 📝 `app/main.py` (+70 -44) </details> ### 📄 Description ## 主要更改 Claude侧模型支持使用客户端请求体中定义的model #23 ## 更改说明 ### 1. `main.py` 读取请求体中的`model`字段, 如果为空则默认赋值为`claude-3-5-sonnet`. 判断环境变量`ENV_CLAUDE_MODEL`是否为空字符串, 若是, 则使用请求体中的model作为claude model进行请求. 优先级: ```txt 环境变量 -> 请求体model字段 -> 默认值"claude-3-5-sonnet" ``` ### 2. `.env.example` 增加`CLAUDE_MODEL`变量说明. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 01:56:14 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/DeepClaude#102
No description provided.