ChatGPTNextWeb / ChatGPTNextWeb/NextChat

[Feature Request] anthropic api 中 system role的实现

Open
#5,856 9 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
88.8k
Forks
59.1k
PR merge metrics
No merged PRs in 30d

Description

### 🥰 Feature Description

您好,我在使用claude的api的时候,发现system的role貌似没有生效,于是去大概查询了下源码和官方api的文档。
发现代码中似乎是使用assistant role模拟了system role的实现,而官方文档有提到system role需要额外传一个system的参数,而不是把system prompt放在message里面。
![image](https://github.com/user-attachments/assets/b69d0136-f68f-433a-a384-6ae03ac389b5)
![image](https://github.com/user-attachments/assets/d88c7603-0c1c-4d02-83f2-2d3981ad7b33)
如果是我误读代码还请见谅,项目庞大无法理解全部
最后感谢你们为开源社区做的贡献,谢谢~
### 🧐 Proposed Solution

修改anthropic client中的system role的实现,通过传递system参数来实现system prompt

### 📝 Additional Information

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Anthropic client and inspecting how system-role messages are converted into the request. Compare that request with Anthropic's documented system parameter; done when system prompts are sent through that parameter and the relevant client behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.