diff options
| author | bobzel <zzzman@gmail.com> | 2025-03-10 16:13:04 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2025-03-10 16:13:04 -0400 |
| commit | b7989dded8bb001876de6cbca59bf77935f0daf7 (patch) | |
| tree | 0dba0665674db7bb84770833df0a4100d0520701 /src/client/views/nodes/chatbot/tools/CalculateTool.ts | |
| parent | 4979415d4604d280e81a162bf9a9d39c731d3738 (diff) | |
| parent | 5bf944035c0ba94ad15245416f51ca0329a51bde (diff) | |
Merge branch 'master' into alyssa-starter
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/CalculateTool.ts')
| -rw-r--r-- | src/client/views/nodes/chatbot/tools/CalculateTool.ts | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/client/views/nodes/chatbot/tools/CalculateTool.ts b/src/client/views/nodes/chatbot/tools/CalculateTool.ts index e96c9a98a..ca7223803 100644 --- a/src/client/views/nodes/chatbot/tools/CalculateTool.ts +++ b/src/client/views/nodes/chatbot/tools/CalculateTool.ts @@ -1,5 +1,5 @@ import { Observation } from '../types/types'; -import { ParametersType } from './ToolTypes'; +import { ParametersType, ToolInfo } from '../types/tool_types'; import { BaseTool } from './BaseTool'; const calculateToolParams = [ @@ -13,15 +13,16 @@ const calculateToolParams = [ type CalculateToolParamsType = typeof calculateToolParams; +const calculateToolInfo: ToolInfo<CalculateToolParamsType> = { + name: 'calculate', + citationRules: 'No citation needed.', + parameterRules: calculateToolParams, + description: 'Runs a calculation and returns the number - uses JavaScript so be sure to use floating point syntax if necessary', +}; + export class CalculateTool extends BaseTool<CalculateToolParamsType> { constructor() { - super( - 'calculate', - 'Perform a calculation', - calculateToolParams, // Use the reusable param config here - 'Provide a mathematical expression to calculate that would work with JavaScript eval().', - 'Runs a calculation and returns the number - uses JavaScript so be sure to use floating point syntax if necessary' - ); + super(calculateToolInfo); } async execute(args: ParametersType<CalculateToolParamsType>): Promise<Observation[]> { |
