mirror of
https://github.com/multipleof4/sune.git
synced 2026-02-04 01:57:55 +00:00
Refactor: remove dot fallback for empty messages
This commit is contained in:
@@ -20,11 +20,6 @@ export const buildBody=()=>{
|
|||||||
// Filter out empty text parts which cause 400 errors on strict providers like Moonshot
|
// Filter out empty text parts which cause 400 errors on strict providers like Moonshot
|
||||||
content = content.filter(p => p.type !== 'text' || (p.text && p.text.trim().length > 0));
|
content = content.filter(p => p.type !== 'text' || (p.text && p.text.trim().length > 0));
|
||||||
|
|
||||||
// Ensure every message has at least some text content if it's otherwise empty (e.g. multimodal only)
|
|
||||||
if (content.length === 0 || !content.some(p => p.type === 'text')) {
|
|
||||||
content.push({type: 'text', text: '.'});
|
|
||||||
}
|
|
||||||
|
|
||||||
msgs.push({
|
msgs.push({
|
||||||
role: m.role,
|
role: m.role,
|
||||||
content: content,
|
content: content,
|
||||||
|
|||||||
Reference in New Issue
Block a user