Merge pull request #3884 from continuedev/dallin/zero-length-arrays
Fix role undefined error
This commit is contained in:
commit
7b9ac83f02
1 changed files with 2 additions and 2 deletions
|
|
@ -399,10 +399,10 @@ function compileChatMessages(
|
|||
|
||||
if (
|
||||
(systemMessage && systemMessage.trim() !== "") ||
|
||||
msgs?.[0].role === "system"
|
||||
msgs?.[0]?.role === "system"
|
||||
) {
|
||||
let content = "";
|
||||
if (msgs?.[0].role === "system") {
|
||||
if (msgs?.[0]?.role === "system") {
|
||||
content = renderChatMessage(msgs?.[0]);
|
||||
}
|
||||
if (systemMessage && systemMessage.trim() !== "") {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue