Tool Development Guide¶
This section describes how to encapsulate your own capabilities as tools (Tools) that can be called by the Agent, and automatically trigger execution during conversations via LLM.
Objectives and Applicable Scenarios¶
Through tool development, you can enable the Agent to call local capabilities to complete specific tasks, such as:
Device control (DAQ, PLC, robotic arms)
File I/O and report generation
Data queries and calculations
Image processing and visual analysis
Device data analysis
Basic Tool Composition¶
A callable tool typically consists of two parts:
VIfile: Specific execution logicJSONdescription: Tool name, function description, parameter definitions, and other metadata
The LLM first reads the JSON description to determine whether to call, then passes parameters to the corresponding VI for execution.
Development Process (Recommended)¶
Design for single responsibility
One tool does one thing (e.g., "query weather", "get current time")
Write and verify VI
Confirm inputs/outputs are stable and exceptions are handled
Write tool JSON
Define
name,description,parameters, required fields
Register to tools directory
Place in the designated tool directory and ensure it can be loaded
Joint debugging in examples
Use
basic_call_tools.viorAI_Agent_Full.vito verify end-to-end flow
Detailed Development Steps¶
Step 1: Create New VI File¶
Open LabVIEW, create a new VI, and write the tool logic. On the front panel, you must include a string output control named result, which is the standard exit for the Agent to retrieve tool execution results.
Example requirements (using "get date and time" as an example):
Output control name:
resultOutput type: String
Output content: Final result text of tool execution
Step 2: Save VI to Tool Directory¶
Save the VI in a separate subfolder under tools\basic_tools. It is recommended to have one folder per tool, and the folder should have the same name as the VI, with an all-English name without spaces.
Example path:
C:\Program Files\National Instruments\LabVIEW 2018\examples\VIRobotics\AI Agent\tools\basic_tools\get_date_and_time
Step 3: Generate Tool JSON¶
Generate the corresponding JSON description file for the current VI using the built-in editor in this toolkit:
Tools -> VIRobotics GenAI -> Agent_VI_Editor
Operation sequence:
Open
Agent_VI_EditorLoad the written VI
Enter VI description, parameter descriptions, and parameter comments
Click "Generate JSON"
Confirm the JSON file has been generated in the same directory as the VI
Debugging and Troubleshooting¶
Common issues:
Tool not triggered: Unclear description or incomplete parameter definitions; folder name does not match VI name
Tool triggered but execution failed: Incorrect VI input types or path configuration
Tool executed successfully but abnormal response: Tool result return format does not meet expectations
Recommendations:
Run VI locally first
Then verify tool calling in
basic_call_tools.viFinally, do comprehensive verification in
AI_Agent_Full.vi
Next Steps¶
See Examples and Applications for tool calling examples
See Troubleshooting for common error locating methods
Technical Support¶
If you encounter issues during use, please first consult the relevant sections or contact technical support:
Technical Support Email: support@virobotics.net
Website: https://www.virobotics.net
QQ Technical Group: 664108337