@degreesign/chat 1.1.0 → 1.3.0
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 +145 -126
- package/dist/browser/chat.min.mjs +1 -1
- package/dist/browser/engine-wllama.min.mjs +1 -1
- package/dist/chat.d.ts +4 -4
- package/dist/describe.d.ts +16 -7
- package/dist/engines/engine.d.ts +12 -12
- package/dist/engines/images.d.ts +8 -8
- package/dist/engines/litert.d.ts +22 -10
- package/dist/engines/store.d.ts +4 -4
- package/dist/engines/threads.d.ts +1 -1
- package/dist/engines/wllama.d.ts +4 -4
- package/dist/enums.d.ts +6 -7
- package/dist/index.d.ts +2 -1
- package/dist/log.d.ts +1 -1
- package/dist/models.d.ts +12 -12
- package/dist/node/chat.node.min.js +1 -1
- package/dist/node/chat.node.min.mjs +1 -1
- package/dist/node/engine-wllama.node.min.js +1 -1
- package/dist/node/engine-wllama.node.min.mjs +1 -1
- package/dist/tools/calculator.d.ts +2 -2
- package/dist/tools/currency.d.ts +3 -3
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/search.d.ts +3 -3
- package/dist/tools/text.d.ts +3 -3
- package/dist/types.d.ts +216 -173
- package/package.json +4 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CalculationResult, ChatTool } from '../types';
|
|
2
|
-
/** Normalize symbols,
|
|
2
|
+
/** Normalize symbols, spaces and commas */
|
|
3
3
|
declare const normalizeExpression: (input: string) => string;
|
|
4
4
|
/** Evaluate one normalized arithmetic expression */
|
|
5
5
|
declare const evaluateExpression: (expression: string) => number;
|
|
6
|
-
/** Parse
|
|
6
|
+
/** Parse expression, rejecting unusable input */
|
|
7
7
|
declare const calculate: (input: string) => CalculationResult;
|
|
8
8
|
declare const calculateTool: ChatTool;
|
|
9
9
|
export { calculate, calculateTool, evaluateExpression, normalizeExpression };
|
package/dist/tools/currency.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ChatTool, ChatToolValue, CurrencyResult, PriceSections } from '../types';
|
|
2
|
-
/** Clear
|
|
2
|
+
/** Clear cache for tests */
|
|
3
3
|
declare const resetPrices: () => void;
|
|
4
|
-
/** Sections
|
|
4
|
+
/** Sections needed for these symbols */
|
|
5
5
|
declare const sectionsFor: (symbols: string[]) => PriceSections;
|
|
6
|
-
/** Convert
|
|
6
|
+
/** Convert amount between two symbols */
|
|
7
7
|
declare const convert: (args: Record<string, ChatToolValue>) => Promise<CurrencyResult>;
|
|
8
8
|
declare const currencyTool: ChatTool;
|
|
9
9
|
export { convert, currencyTool, resetPrices, sectionsFor };
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import { calculateTool } from './calculator';
|
|
|
3
3
|
import { currencyTool } from './currency';
|
|
4
4
|
import { webSearchTool } from './search';
|
|
5
5
|
import type { ChatTool, WebSearchConfig } from '../types';
|
|
6
|
-
/** Build
|
|
6
|
+
/** Build built-ins in given order */
|
|
7
7
|
declare const builtinTools: (builtins: BuiltinTool[], config?: WebSearchConfig) => ChatTool[];
|
|
8
8
|
export { builtinTools, calculateTool, currencyTool, webSearchTool };
|
package/dist/tools/search.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ChatTool, WebSearchConfig, WebSearchResult, WebSearchSettings } from '../types';
|
|
2
|
-
/** Resolve
|
|
2
|
+
/** Resolve settings, clamp caller values */
|
|
3
3
|
declare const searchSettings: (config?: WebSearchConfig) => WebSearchSettings;
|
|
4
|
-
/** Search Wikipedia
|
|
4
|
+
/** Search Wikipedia, map matching pages */
|
|
5
5
|
declare const wikipediaResults: (settings: WebSearchSettings, query: string) => Promise<WebSearchResult[]>;
|
|
6
|
-
/** Search DuckDuckGo
|
|
6
|
+
/** Search DuckDuckGo, map answers */
|
|
7
7
|
declare const duckDuckGoResults: (settings: WebSearchSettings, query: string) => Promise<WebSearchResult[]>;
|
|
8
8
|
declare const webSearchTool: (config?: WebSearchConfig) => ChatTool;
|
|
9
9
|
export { duckDuckGoResults, searchSettings, webSearchTool, wikipediaResults, };
|
package/dist/tools/text.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** Clamp
|
|
1
|
+
/** Clamp numeric setting into range */
|
|
2
2
|
declare const clampNumber: (value: number | undefined, min: number, max: number, fallback: number) => number;
|
|
3
|
-
/** Decode
|
|
3
|
+
/** Decode entity, keep unknown ones */
|
|
4
4
|
declare const decodeEntity: (entity: string) => string;
|
|
5
|
-
/** Strip tags, decode
|
|
5
|
+
/** Strip tags, decode, collapse, cap */
|
|
6
6
|
declare const plainText: (text: string, max: number) => string;
|
|
7
7
|
export { clampNumber, decodeEntity, plainText };
|