fix: 修改请求体字段名 (#12430)

This commit is contained in:
SuYao 2026-01-12 16:38:55 +08:00 committed by GitHub
parent cbeda03acb
commit 9414f13f6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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' }