Don't add items of unknown type to chat completion
This commit is contained in:
parent
4e55126606
commit
2f5e7778cc
|
@ -1982,8 +1982,7 @@ class ChatCompletion {
|
||||||
const message = { role: item.role, content: item.content, ...(item.name ? { name: item.name } : {}) };
|
const message = { role: item.role, content: item.content, ...(item.name ? { name: item.name } : {}) };
|
||||||
chat.push(message);
|
chat.push(message);
|
||||||
} else {
|
} else {
|
||||||
this.log(`Item ${item} has an unknown type. Adding as-is`);
|
console.warn('Invalid message in collection', item);
|
||||||
chat.push(item);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return chat;
|
return chat;
|
||||||
|
|
Loading…
Reference in New Issue