@gendive/chatllm 0.17.16 → 0.17.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/index.js +15 -14
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +15 -14
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1447,12 +1447,12 @@ var parsePollFromContent = (content) => {
|
|
|
1447
1447
|
let optionMatch;
|
|
1448
1448
|
while ((optionMatch = optionTagRegex.exec(innerContent)) !== null) {
|
|
1449
1449
|
const optionAttrs = optionMatch[1];
|
|
1450
|
-
const optionLabel =
|
|
1450
|
+
const optionLabel = optionMatch[2].trim();
|
|
1451
1451
|
const descMatch = optionAttrs.match(/description=["']([^"']+)["']/i);
|
|
1452
1452
|
options.push({
|
|
1453
1453
|
id: generateId2(),
|
|
1454
1454
|
label: optionLabel,
|
|
1455
|
-
description: descMatch?.[1]
|
|
1455
|
+
description: descMatch?.[1] || void 0
|
|
1456
1456
|
});
|
|
1457
1457
|
}
|
|
1458
1458
|
if (options.length === 0) {
|
|
@@ -1462,8 +1462,8 @@ var parsePollFromContent = (content) => {
|
|
|
1462
1462
|
const fullText = listMatch[1].trim();
|
|
1463
1463
|
const colonIndex = fullText.indexOf(":");
|
|
1464
1464
|
if (colonIndex > 0) {
|
|
1465
|
-
const label =
|
|
1466
|
-
const description =
|
|
1465
|
+
const label = fullText.substring(0, colonIndex).trim();
|
|
1466
|
+
const description = fullText.substring(colonIndex + 1).trim();
|
|
1467
1467
|
options.push({
|
|
1468
1468
|
id: generateId2(),
|
|
1469
1469
|
label,
|
|
@@ -1472,7 +1472,7 @@ var parsePollFromContent = (content) => {
|
|
|
1472
1472
|
} else {
|
|
1473
1473
|
options.push({
|
|
1474
1474
|
id: generateId2(),
|
|
1475
|
-
label:
|
|
1475
|
+
label: fullText
|
|
1476
1476
|
});
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
@@ -1483,14 +1483,14 @@ var parsePollFromContent = (content) => {
|
|
|
1483
1483
|
while ((numMatch = numberedRegex.exec(innerContent)) !== null) {
|
|
1484
1484
|
options.push({
|
|
1485
1485
|
id: generateId2(),
|
|
1486
|
-
label:
|
|
1486
|
+
label: numMatch[1].trim()
|
|
1487
1487
|
});
|
|
1488
1488
|
}
|
|
1489
1489
|
}
|
|
1490
1490
|
if (questionText && options.length >= 2) {
|
|
1491
1491
|
const pollQuestion = {
|
|
1492
1492
|
id: generateId2(),
|
|
1493
|
-
question:
|
|
1493
|
+
question: questionText,
|
|
1494
1494
|
options,
|
|
1495
1495
|
multiSelect,
|
|
1496
1496
|
allowOther,
|
|
@@ -1520,7 +1520,7 @@ var parsePollFromContent = (content) => {
|
|
|
1520
1520
|
};
|
|
1521
1521
|
};
|
|
1522
1522
|
var formatPollResponse = (question, selectedOptions, otherText) => {
|
|
1523
|
-
const selectedLabels = question.options.filter((opt) => selectedOptions.includes(opt.id)).map((opt) => opt.label);
|
|
1523
|
+
const selectedLabels = question.options.filter((opt) => selectedOptions.includes(opt.id)).map((opt) => stripInlineMarkdown(opt.label));
|
|
1524
1524
|
if (otherText) {
|
|
1525
1525
|
selectedLabels.push(otherText);
|
|
1526
1526
|
}
|
|
@@ -2585,6 +2585,8 @@ ${finalContent}`;
|
|
|
2585
2585
|
}
|
|
2586
2586
|
abortControllerRef.current = new AbortController();
|
|
2587
2587
|
try {
|
|
2588
|
+
const shouldSkipSkillParsing = skipNextSkillParsingRef.current;
|
|
2589
|
+
skipNextSkillParsingRef.current = false;
|
|
2588
2590
|
let messagesToSend = [...existingMessages, userMessage];
|
|
2589
2591
|
const recompressionThreshold = DEFAULT_RECOMPRESSION_THRESHOLD;
|
|
2590
2592
|
const tokenLimit = DEFAULT_TOKEN_LIMIT;
|
|
@@ -2648,11 +2650,12 @@ ${part.result.content}`).join("\n\n");
|
|
|
2648
2650
|
if (attachmentContext) {
|
|
2649
2651
|
chatMessages.push({
|
|
2650
2652
|
role: "user",
|
|
2651
|
-
|
|
2653
|
+
/** @Todo vibecode - 원본 파일 재요청 방지 + skill_use 태그 사용 금지 명시 */
|
|
2654
|
+
content: `\uC0AC\uC6A9\uC790\uAC00 \uCCA8\uBD80\uD55C \uD30C\uC77C\uC758 \uBD84\uC11D \uACB0\uACFC\uC785\uB2C8\uB2E4. \uC6D0\uBCF8 \uD30C\uC77C \uB0B4\uC6A9\uC774 \uC774\uBBF8 \uC544\uB798\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC73C\uBBC0\uB85C \uC6D0\uBCF8 \uD30C\uC77C\uC744 \uB2E4\uC2DC \uC694\uCCAD\uD558\uC9C0 \uB9C8\uC138\uC694.
|
|
2652
2655
|
|
|
2653
2656
|
${attachmentContext}
|
|
2654
2657
|
|
|
2655
|
-
\uC704 \uACB0\uACFC\
|
|
2658
|
+
\uC704 \uBD84\uC11D \uACB0\uACFC\uB9CC\uC73C\uB85C \uC0AC\uC6A9\uC790\uC758 \uC9C8\uBB38\uC5D0 \uB2F5\uBCC0\uD574\uC8FC\uC138\uC694. skill_use \uD0DC\uADF8\uB294 \uC0AC\uC6A9\uD558\uC9C0 \uB9C8\uC138\uC694.`
|
|
2656
2659
|
});
|
|
2657
2660
|
}
|
|
2658
2661
|
}
|
|
@@ -2746,7 +2749,7 @@ ${attachmentContext}
|
|
|
2746
2749
|
const thinking = parsed.message?.thinking || "";
|
|
2747
2750
|
if (content2 || thinking) {
|
|
2748
2751
|
if (content2) accumulatedContent += content2;
|
|
2749
|
-
if (!
|
|
2752
|
+
if (!shouldSkipSkillParsing && accumulatedContent.includes("</skill_use>")) {
|
|
2750
2753
|
const endIdx = accumulatedContent.indexOf("</skill_use>");
|
|
2751
2754
|
accumulatedContent = accumulatedContent.substring(0, endIdx + "</skill_use>".length);
|
|
2752
2755
|
skillTagDetected = true;
|
|
@@ -2813,7 +2816,7 @@ ${attachmentContext}
|
|
|
2813
2816
|
} catch {
|
|
2814
2817
|
}
|
|
2815
2818
|
}
|
|
2816
|
-
if (!
|
|
2819
|
+
if (!shouldSkipSkillParsing) {
|
|
2817
2820
|
const assistantContent = accumulatedContent;
|
|
2818
2821
|
const { skillCall: detectedSkill, cleanContent: skillCleanContent } = parseSkillCallFromContent(assistantContent);
|
|
2819
2822
|
if (detectedSkill && resolvedSkills[detectedSkill.name]) {
|
|
@@ -2994,8 +2997,6 @@ ${result.content}
|
|
|
2994
2997
|
return;
|
|
2995
2998
|
}
|
|
2996
2999
|
}
|
|
2997
|
-
} else {
|
|
2998
|
-
skipNextSkillParsingRef.current = false;
|
|
2999
3000
|
}
|
|
3000
3001
|
setSessions(
|
|
3001
3002
|
(prev) => prev.map((s) => {
|