@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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chat_default
3
- } from "./chunk-ZYQJVZK2.mjs";
3
+ } from "./chunk-EHBZ4D7R.mjs";
4
4
  import "./chunk-ONQMRE2G.mjs";
5
5
  import "./chunk-U633CJBV.mjs";
6
6
  import "./chunk-IDZEEONG.mjs";
@@ -13,4 +13,4 @@ import "./chunk-BJTO5JO5.mjs";
13
13
  export {
14
14
  chat_default as default
15
15
  };
16
- //# sourceMappingURL=chat-IWRBVOVP.mjs.map
16
+ //# sourceMappingURL=chat-5QSGMPHN.mjs.map
@@ -3117,7 +3117,7 @@ TOOL USAGE PROTOCOL (conservative approach)
3117
3117
  - Use your training data and general knowledge confidently for common topics, concepts, and questions.
3118
3118
  - Only call tools for SPECIFIC, CURRENT information that requires real-time data or a source you don't already have:
3119
3119
  * 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
3120
- * web_fetch() - ONLY when you already have a specific URL whose contents you need to read
3120
+ * 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)
3121
3121
  * image_generation() - ONLY when explicitly asked to create or generate an image
3122
3122
  - For general questions about concepts, definitions, explanations, or how-to topics, use your built-in knowledge WITHOUT calling tools.
3123
3123
  - Examples of what NOT to use tools for: "who are you?", "what is React?", "explain machine learning", "how does X work?", general programming questions.
@@ -3435,7 +3435,7 @@ ${r.output}`).join("\n\n");
3435
3435
 
3436
3436
  ${toolResultsText}
3437
3437
 
3438
- 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.`
3438
+ 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.`
3439
3439
  }
3440
3440
  ];
3441
3441
  const summaryRequest = {
@@ -3490,6 +3490,10 @@ _Writing the answer\u2026_` : "_Writing the answer\u2026_"
3490
3490
  }, 3e4);
3491
3491
  });
3492
3492
  if (summaryText.trim()) {
3493
+ const cleanedSummary = summaryText.replace(
3494
+ /\n{1,}\s*(?:[*_#>\s]*)(?:sources?|references?|citations?|further reading)(?:\s*:)?\s*(?:[*_]*)\s*\n[\s\S]*$/i,
3495
+ ""
3496
+ ).trimEnd();
3493
3497
  const sourcesMd = collectedSources.length ? `
3494
3498
 
3495
3499
  **Sources**
@@ -3501,7 +3505,7 @@ ${collectedSources.slice(0, 6).map((s) => {
3501
3505
  }
3502
3506
  return `- [${s.title || domain}](${s.url}) \u2014 ${domain}`;
3503
3507
  }).join("\n")}` : "";
3504
- enhancedMessage = summaryText + sourcesMd + (inlineImageBlocks.length ? `
3508
+ enhancedMessage = cleanedSummary + sourcesMd + (inlineImageBlocks.length ? `
3505
3509
 
3506
3510
  ${inlineImageBlocks.join("\n\n")}` : "");
3507
3511
  }
@@ -9749,4 +9753,4 @@ var chat_default = Chat;
9749
9753
  export {
9750
9754
  chat_default
9751
9755
  };
9752
- //# sourceMappingURL=chunk-ZYQJVZK2.mjs.map
9756
+ //# sourceMappingURL=chunk-EHBZ4D7R.mjs.map