mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-13 13:47:28 +08:00
fix: 修改请求体字段名 (#12430)
This commit is contained in:
parent
cbeda03acb
commit
9414f13f6d
@ -325,9 +325,9 @@ function createDeveloperToSystemFetch(originalFetch?: typeof fetch): typeof fetc
|
||||
if (options?.body && typeof options.body === 'string') {
|
||||
try {
|
||||
const body = JSON.parse(options.body)
|
||||
if (body.messages && Array.isArray(body.messages)) {
|
||||
if (body.input && Array.isArray(body.input)) {
|
||||
let hasChanges = false
|
||||
body.messages = body.messages.map((msg: { role: string }) => {
|
||||
body.input = body.input.map((msg: { role: string }) => {
|
||||
if (msg.role === 'developer') {
|
||||
hasChanges = true
|
||||
return { ...msg, role: 'system' }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user