mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-13 21:57:30 +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') {
|
if (options?.body && typeof options.body === 'string') {
|
||||||
try {
|
try {
|
||||||
const body = JSON.parse(options.body)
|
const body = JSON.parse(options.body)
|
||||||
if (body.messages && Array.isArray(body.messages)) {
|
if (body.input && Array.isArray(body.input)) {
|
||||||
let hasChanges = false
|
let hasChanges = false
|
||||||
body.messages = body.messages.map((msg: { role: string }) => {
|
body.input = body.input.map((msg: { role: string }) => {
|
||||||
if (msg.role === 'developer') {
|
if (msg.role === 'developer') {
|
||||||
hasChanges = true
|
hasChanges = true
|
||||||
return { ...msg, role: 'system' }
|
return { ...msg, role: 'system' }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user