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 } : {}) };
|
||||
chat.push(message);
|
||||
} else {
|
||||
this.log(`Item ${item} has an unknown type. Adding as-is`);
|
||||
chat.push(item);
|
||||
console.warn('Invalid message in collection', item);
|
||||
}
|
||||
}
|
||||
return chat;
|
||||
|
|
Loading…
Reference in New Issue