@degreesign/chat 1.0.2 → 1.2.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.
@@ -1,9 +1,9 @@
1
1
  import type { CalculationResult, ChatTool } from '../types';
2
- /** Normalize symbols, then drop spaces and thousands commas */
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 and evaluate one expression, rejecting unusable input */
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 };
@@ -1,9 +1,9 @@
1
1
  import type { ChatTool, ChatToolValue, CurrencyResult, PriceSections } from '../types';
2
- /** Clear the cache, used by tests */
2
+ /** Clear cache for tests */
3
3
  declare const resetPrices: () => void;
4
- /** Sections one request has to read for these symbols */
4
+ /** Sections needed for these symbols */
5
5
  declare const sectionsFor: (symbols: string[]) => PriceSections;
6
- /** Convert one amount between two symbols */
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 };
@@ -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 the requested built-ins, in the order given */
6
+ /** Build built-ins in given order */
7
7
  declare const builtinTools: (builtins: BuiltinTool[], config?: WebSearchConfig) => ChatTool[];
8
8
  export { builtinTools, calculateTool, currencyTool, webSearchTool };
@@ -1,9 +1,9 @@
1
1
  import type { ChatTool, WebSearchConfig, WebSearchResult, WebSearchSettings } from '../types';
2
- /** Resolve every search setting and clamp the caller values */
2
+ /** Resolve settings, clamp caller values */
3
3
  declare const searchSettings: (config?: WebSearchConfig) => WebSearchSettings;
4
- /** Search Wikipedia and map the matching pages */
4
+ /** Search Wikipedia, map matching pages */
5
5
  declare const wikipediaResults: (settings: WebSearchSettings, query: string) => Promise<WebSearchResult[]>;
6
- /** Search DuckDuckGo and map the instant answer and topics */
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, };
@@ -1,7 +1,7 @@
1
- /** Clamp one numeric setting into a range */
1
+ /** Clamp numeric setting into range */
2
2
  declare const clampNumber: (value: number | undefined, min: number, max: number, fallback: number) => number;
3
- /** Decode one entity reference, keeping it when it is unknown */
3
+ /** Decode entity, keep unknown ones */
4
4
  declare const decodeEntity: (entity: string) => string;
5
- /** Strip tags, decode entities, collapse whitespace and cap the text */
5
+ /** Strip tags, decode, collapse, cap */
6
6
  declare const plainText: (text: string, max: number) => string;
7
7
  export { clampNumber, decodeEntity, plainText };