mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-03 00:00:58 +08:00
fix: Anthropic Claude 网页对话格式修改
This commit is contained in:
@@ -133,8 +133,9 @@ export function toClaudeFormat(messages: UnifiedMessage[]): { messages: ClaudeMe
|
|||||||
for (const msg of messages) {
|
for (const msg of messages) {
|
||||||
// Claude 的 system 消息需要单独提取
|
// Claude 的 system 消息需要单独提取
|
||||||
if (msg.role === 'system') {
|
if (msg.role === 'system') {
|
||||||
systemPrompt = typeof msg.content === 'string' ? msg.content : msg.content.map(c => c.text || '').join('');
|
msg.role = 'assistant';
|
||||||
continue;
|
// systemPrompt = typeof msg.content === 'string' ? msg.content : msg.content.map(c => c.text || '').join('');
|
||||||
|
// continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const role = msg.role === 'model' ? 'assistant' : msg.role;
|
const role = msg.role === 'model' ? 'assistant' : msg.role;
|
||||||
|
|||||||
Reference in New Issue
Block a user