@burtson-labs/bandit-engine 2.0.66 → 2.0.68

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-ZYQJVZK2.mjs";
3
+ } from "./chunk-EHBZ4D7R.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-EM2DB6NP.mjs";
13
+ } from "./chunk-HUUWQOBF.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.
@@ -23315,7 +23315,7 @@ ${r.output}`).join("\n\n");
23315
23315
 
23316
23316
  ${toolResultsText}
23317
23317
 
23318
- Using these results together with your own knowledge, answer my original question concisely and in a natural, well-formatted way. Reference sources by name where relevant, but do NOT paste raw URLs or a list of links \u2014 a clean Sources section is added automatically below your answer. Do NOT output tool_code or call any tools again.`
23318
+ Using these results together with your own knowledge, answer my original question concisely and in a natural, well-formatted way. Do NOT add a "Sources", "References", or "Citations" list of any kind \u2014 not names and not URLs. A clean, clickable Sources section is appended automatically below your answer, so any list you add just duplicates it. (Mentioning a source naturally inside a sentence is fine; a trailing list is not.) Do NOT output tool_code or call any tools again.`
23319
23319
  }
23320
23320
  ];
23321
23321
  const summaryRequest = {
@@ -23370,6 +23370,10 @@ _Writing the answer\u2026_` : "_Writing the answer\u2026_"
23370
23370
  }, 3e4);
23371
23371
  });
23372
23372
  if (summaryText.trim()) {
23373
+ const cleanedSummary = summaryText.replace(
23374
+ /\n{1,}\s*(?:[*_#>\s]*)(?:sources?|references?|citations?|further reading)(?:\s*:)?\s*(?:[*_]*)\s*\n[\s\S]*$/i,
23375
+ ""
23376
+ ).trimEnd();
23373
23377
  const sourcesMd = collectedSources.length ? `
23374
23378
 
23375
23379
  **Sources**
@@ -23381,7 +23385,7 @@ ${collectedSources.slice(0, 6).map((s) => {
23381
23385
  }
23382
23386
  return `- [${s.title || domain}](${s.url}) \u2014 ${domain}`;
23383
23387
  }).join("\n")}` : "";
23384
- enhancedMessage = summaryText + sourcesMd + (inlineImageBlocks.length ? `
23388
+ enhancedMessage = cleanedSummary + sourcesMd + (inlineImageBlocks.length ? `
23385
23389
 
23386
23390
  ${inlineImageBlocks.join("\n\n")}` : "");
23387
23391
  }