fix: Preserve system prompt when sent as a string instead of content block array
This commit is contained in:
@@ -1266,6 +1266,10 @@ func checkSystemInstructionsWithMode(payload []byte, strictMode bool) []byte {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
} else if system.Type == gjson.String && system.String() != "" {
|
||||||
|
partJSON := `{"type":"text","cache_control":{"type":"ephemeral"}}`
|
||||||
|
partJSON, _ = sjson.Set(partJSON, "text", system.String())
|
||||||
|
result += "," + partJSON
|
||||||
}
|
}
|
||||||
result += "]"
|
result += "]"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user