@burtson-labs/bandit-engine 2.0.67 → 2.0.69

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/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chat_default
3
- } from "./chunk-5UD7EJ23.mjs";
3
+ } from "./chunk-6KU3NOZW.mjs";
4
4
  import {
5
5
  chat_provider_default
6
6
  } from "./chunk-HHMGNCBS.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  useGatewayHealth,
11
11
  useGatewayMemory,
12
12
  useGatewayModels
13
- } from "./chunk-RI4LBQ3Q.mjs";
13
+ } from "./chunk-NL4BY4YL.mjs";
14
14
  import "./chunk-U633CJBV.mjs";
15
15
  import "./chunk-6ITUH375.mjs";
16
16
  import "./chunk-IDZEEONG.mjs";
@@ -22997,7 +22997,7 @@ TOOL USAGE PROTOCOL (conservative approach)
22997
22997
  - Use your training data and general knowledge confidently for common topics, concepts, and questions.
22998
22998
  - Only call tools for SPECIFIC, CURRENT information that requires real-time data or a source you don't already have:
22999
22999
  * web_search() - when asked about recent/current events, breaking news, live information (weather, prices, sports scores), or when you need to look up documentation, libraries, APIs, error messages, or verify a specific fact
23000
- * web_fetch() - ONLY when you already have a specific URL whose contents you need to read
23000
+ * web_fetch() - to read the FULL contents of a specific URL you already have. Reach for this when the user wants to "tell me more", "go deeper", "read/open that article", or asks for details about a specific source, link, or article from an EARLIER answer: take that item's URL from the previous Sources list in this conversation and fetch it, then answer from the page's actual content (not just the prior summary)
23001
23001
  * image_generation() - ONLY when explicitly asked to create or generate an image
23002
23002
  - For general questions about concepts, definitions, explanations, or how-to topics, use your built-in knowledge WITHOUT calling tools.
23003
23003
  - Examples of what NOT to use tools for: "who are you?", "what is React?", "explain machine learning", "how does X work?", general programming questions.
@@ -23325,12 +23325,8 @@ Using these results together with your own knowledge, answer my original questio
23325
23325
  options: { num_predict: tokenLimit + 250 }
23326
23326
  };
23327
23327
  clearFlushTimer();
23328
- const summaryPreamble = stripToolBlocks(fullMessage).trim();
23329
- setStreamBuffer(
23330
- summaryPreamble ? `${summaryPreamble}
23331
-
23332
- _Writing the answer\u2026_` : "_Writing the answer\u2026_"
23333
- );
23328
+ setStreamBuffer("");
23329
+ setIsThinking?.(true);
23334
23330
  const summaryText = await new Promise((resolve) => {
23335
23331
  let acc = "";
23336
23332
  let settled = false;
@@ -23348,6 +23344,7 @@ _Writing the answer\u2026_` : "_Writing the answer\u2026_"
23348
23344
  const visible = stripThinking(acc);
23349
23345
  latestDisplayMessage = visible;
23350
23346
  lastPartialRef.current.text = visible;
23347
+ if (visible) setIsThinking?.(false);
23351
23348
  setStreamBuffer(visible);
23352
23349
  }
23353
23350
  },
@@ -23369,6 +23366,7 @@ _Writing the answer\u2026_` : "_Writing the answer\u2026_"
23369
23366
  done("");
23370
23367
  }, 3e4);
23371
23368
  });
23369
+ setIsThinking?.(false);
23372
23370
  if (summaryText.trim()) {
23373
23371
  const cleanedSummary = summaryText.replace(
23374
23372
  /\n{1,}\s*(?:[*_#>\s]*)(?:sources?|references?|citations?|further reading)(?:\s*:)?\s*(?:[*_]*)\s*\n[\s\S]*$/i,