feat(listLineOutputParser): handle unclosed tags

This commit is contained in:
ItzCrazyKns 2024-10-30 10:29:21 +05:30 committed by Damien Laureaux
parent 3470d5dab8
commit 72f9ffc012
No known key found for this signature in database
GPG key ID: 3802EADA1C1C604D

View file

@ -23,7 +23,7 @@ class LineListOutputParser extends BaseOutputParser<string[]> {
const startKeyIndex = text.indexOf(`<${this.key}>`);
const endKeyIndex = text.indexOf(`</${this.key}>`);
if (startKeyIndex === -1 || endKeyIndex === -1) {
if (startKeyIndex === -1 && endKeyIndex === -1) {
return [];
}