@adminforth/agent 3.5.2 → 3.5.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.
- package/README.md +2 -2
- package/dist/shared/sanitizeSpeechText.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -319,8 +319,8 @@ export const globalPlugins = [
|
|
|
319
319
|
new AdminForthAgent({
|
|
320
320
|
// The first mode is the default. Users can switch modes in the chat UI.
|
|
321
321
|
modes: [
|
|
322
|
-
{ name: 'Balanced', completionAdapter: createCompletionAdapter('gpt-
|
|
323
|
-
{ name: 'Fast', completionAdapter: createCompletionAdapter('gpt-
|
|
322
|
+
{ name: 'Balanced', completionAdapter: createCompletionAdapter('gpt-6-luna', 'medium') },
|
|
323
|
+
{ name: 'Fast', completionAdapter: createCompletionAdapter('gpt-6-luna', 'low') },
|
|
324
324
|
{ name: 'Smart Thinking', completionAdapter: createCompletionAdapter('gpt-5.4', 'high') },
|
|
325
325
|
],
|
|
326
326
|
maxTokens: 10000,
|
|
@@ -3,6 +3,8 @@ const MARKDOWN_LINK_RE = /\[([^\]]+)]\(([^)]+)\)/g;
|
|
|
3
3
|
const MARKDOWN_IMAGE_RE = /!\[([^\]]*)]\(([^)]+)\)/g;
|
|
4
4
|
const HTML_TAG_RE = /<[^>]+>/g;
|
|
5
5
|
const CODE_FENCE_RE = /```[\s\S]*?```/g;
|
|
6
|
+
// a markdown table row: a whole line between pipes
|
|
7
|
+
const MD_TABLE_ROW_RE = /^\s*\|.*\|\s*$/gm;
|
|
6
8
|
const INLINE_CODE_RE = /`[^`]*`/g;
|
|
7
9
|
const BRACKETED_META_RE = /\[(?:ref|link|url|source|sources?|debug|meta|data):[^\]]*]/gi;
|
|
8
10
|
const MD_HEADING_LINE_RE = /^\s{0,3}#{1,6}\s+/gm;
|
|
@@ -14,6 +16,8 @@ const MD_ITALIC_RE = /(^|[^\\])(?:\*|_)([^\s].*?)(?:\*|_)/g;
|
|
|
14
16
|
export function sanitizeSpeechText(input) {
|
|
15
17
|
return input
|
|
16
18
|
.replace(CODE_FENCE_RE, " ")
|
|
19
|
+
// tables stay in the chat, reading them cell by cell is long and costs audio tokens
|
|
20
|
+
.replace(MD_TABLE_ROW_RE, " ")
|
|
17
21
|
.replace(MARKDOWN_IMAGE_RE, "$1")
|
|
18
22
|
.replace(MARKDOWN_LINK_RE, "$1")
|
|
19
23
|
.replace(URL_RE, " ")
|