@gendive/chatllm 0.12.0 → 0.12.1

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.
@@ -512,7 +512,10 @@ function useInfoExtraction(options) {
512
512
  if (data === "[DONE]") continue;
513
513
  try {
514
514
  const parsed = JSON.parse(data);
515
- if (parsed.content) fullResponse += parsed.content;
515
+ {
516
+ const chunk = parsed.content ?? parsed.text ?? "";
517
+ if (chunk) fullResponse += chunk;
518
+ }
516
519
  } catch {
517
520
  }
518
521
  }
@@ -672,7 +675,7 @@ var callLLMStream = async (prompt, opts, onChunk) => {
672
675
  if (data === "[DONE]") continue;
673
676
  try {
674
677
  const parsed = JSON.parse(data);
675
- const content = parsed.choices?.[0]?.delta?.content || parsed.delta?.content || parsed.message?.content || "";
678
+ const content = parsed.choices?.[0]?.delta?.content || parsed.delta?.content || parsed.message?.content || parsed.content || parsed.text || "";
676
679
  if (content) {
677
680
  fullContent += content;
678
681
  onChunk(content);
@@ -1489,7 +1492,10 @@ ${conversationText}
1489
1492
  if (data === "[DONE]") continue;
1490
1493
  try {
1491
1494
  const parsed = JSON.parse(data);
1492
- if (parsed.content) summary += parsed.content;
1495
+ {
1496
+ const chunk = parsed.content ?? parsed.text ?? "";
1497
+ if (chunk) summary += chunk;
1498
+ }
1493
1499
  } catch {
1494
1500
  }
1495
1501
  }
@@ -1545,7 +1551,10 @@ ${newConversation}
1545
1551
  if (data === "[DONE]") continue;
1546
1552
  try {
1547
1553
  const parsed = JSON.parse(data);
1548
- if (parsed.content) summary += parsed.content;
1554
+ {
1555
+ const chunk = parsed.content ?? parsed.text ?? "";
1556
+ if (chunk) summary += chunk;
1557
+ }
1549
1558
  } catch {
1550
1559
  }
1551
1560
  }
@@ -1945,7 +1954,7 @@ ${currentContextSummary}` },
1945
1954
  }
1946
1955
  try {
1947
1956
  const parsed = JSON.parse(data);
1948
- const content2 = parsed.message?.content || parsed.content || "";
1957
+ const content2 = parsed.message?.content || parsed.content || parsed.text || "";
1949
1958
  const thinking = parsed.message?.thinking || "";
1950
1959
  if (content2 || thinking) {
1951
1960
  if (content2) accumulatedContent += content2;
@@ -1985,7 +1994,7 @@ ${currentContextSummary}` },
1985
1994
  if (buffer.trim()) {
1986
1995
  try {
1987
1996
  const parsed = JSON.parse(buffer);
1988
- const content2 = parsed.message?.content || parsed.content;
1997
+ const content2 = parsed.message?.content || parsed.content || parsed.text;
1989
1998
  if (content2) {
1990
1999
  accumulatedContent += content2;
1991
2000
  setSessions(
@@ -2354,7 +2363,7 @@ ${formattedParts.join("\n")}
2354
2363
  }
2355
2364
  try {
2356
2365
  const parsed = JSON.parse(data);
2357
- const content = parsed.message?.content || parsed.content || "";
2366
+ const content = parsed.message?.content || parsed.content || parsed.text || "";
2358
2367
  const thinking = parsed.message?.thinking || "";
2359
2368
  if (content || thinking) {
2360
2369
  setSessions(
@@ -2393,7 +2402,7 @@ ${formattedParts.join("\n")}
2393
2402
  if (buffer.trim()) {
2394
2403
  try {
2395
2404
  const parsed = JSON.parse(buffer);
2396
- const content = parsed.message?.content || parsed.content || "";
2405
+ const content = parsed.message?.content || parsed.content || parsed.text || "";
2397
2406
  const thinking = parsed.message?.thinking || "";
2398
2407
  if (content || thinking) {
2399
2408
  setSessions(
@@ -2497,7 +2506,10 @@ ${currentSession.contextSummary}` },
2497
2506
  if (data === "[DONE]") continue;
2498
2507
  try {
2499
2508
  const parsed = JSON.parse(data);
2500
- if (parsed.content) responseContent += parsed.content;
2509
+ {
2510
+ const chunk = parsed.content ?? parsed.text ?? "";
2511
+ if (chunk) responseContent += chunk;
2512
+ }
2501
2513
  } catch {
2502
2514
  }
2503
2515
  }
@@ -2536,7 +2548,10 @@ ${currentSession.contextSummary}` },
2536
2548
  if (data === "[DONE]") continue;
2537
2549
  try {
2538
2550
  const parsed = JSON.parse(data);
2539
- if (parsed.content) responseContent += parsed.content;
2551
+ {
2552
+ const chunk = parsed.content ?? parsed.text ?? "";
2553
+ if (chunk) responseContent += chunk;
2554
+ }
2540
2555
  } catch {
2541
2556
  }
2542
2557
  }