@gendive/chatllm 0.15.2 → 0.15.3

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.
@@ -2129,6 +2129,7 @@ ${currentContextSummary}` },
2129
2129
  const decoder = new TextDecoder();
2130
2130
  let buffer = "";
2131
2131
  let accumulatedContent = "";
2132
+ let skillTagDetected = false;
2132
2133
  while (true) {
2133
2134
  const { done, value } = await reader.read();
2134
2135
  if (done) break;
@@ -2148,6 +2149,12 @@ ${currentContextSummary}` },
2148
2149
  const thinking = parsed.message?.thinking || "";
2149
2150
  if (content2 || thinking) {
2150
2151
  if (content2) accumulatedContent += content2;
2152
+ if (!skipNextSkillParsingRef.current && accumulatedContent.includes("</skill_use>")) {
2153
+ const endIdx = accumulatedContent.indexOf("</skill_use>");
2154
+ accumulatedContent = accumulatedContent.substring(0, endIdx + "</skill_use>".length);
2155
+ skillTagDetected = true;
2156
+ }
2157
+ const displayContent = skillTagDetected ? accumulatedContent : null;
2151
2158
  setSessions(
2152
2159
  (prev) => prev.map((s) => {
2153
2160
  if (s.id === capturedSessionId) {
@@ -2155,6 +2162,9 @@ ${currentContextSummary}` },
2155
2162
  ...s,
2156
2163
  messages: s.messages.map((m) => {
2157
2164
  if (m.id !== assistantMessageId) return m;
2165
+ if (displayContent) {
2166
+ return { ...m, content: displayContent };
2167
+ }
2158
2168
  let newContent = m.content;
2159
2169
  if (thinking) {
2160
2170
  if (!newContent.includes("<thinking>")) {
@@ -2176,10 +2186,12 @@ ${currentContextSummary}` },
2176
2186
  return s;
2177
2187
  })
2178
2188
  );
2189
+ if (skillTagDetected) break;
2179
2190
  }
2180
2191
  } catch {
2181
2192
  }
2182
2193
  }
2194
+ if (skillTagDetected) break;
2183
2195
  }
2184
2196
  if (buffer.trim()) {
2185
2197
  try {