llm.Tool
The content in this help topic pertains to SuiteScript 2.1.
|
Object Description |
A tool returned from llm.createTool(options). This object represents a callable operation that the large language model (LLM) can request to augment its responses. Tools are custom utilities that you define, and they let the LLM retrieve external data (such as data from NetSuite using SuiteQL), perform calculations, or trigger business logic as part of an LLM interaction. This object is used to inform the LLM about which operations are available to invoke as it generates its response. You create this object using the llm.createTool(options) method. This object includes properties for the tool name (Tool.name), tool description (Tool.description), and a set of input parameters (Tool.parameters). When you call llm.generateText(options) or llm.generateTextStreamed(options), you can use the |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
|
Module |
|
|
Methods and Properties |
|
|
Since |
2025.2 |
Syntax
The following code sample shows the syntax for this member. It isn't a functional example. For a complete script example, see N/llm Module Script Samples.
// Add additional code
...
const findUserIdTool = llm.createTool({
name: "findUserId",
description: "Looks up user ID based on user name",
parameters: [
llm.createToolParameter({
name: "userName",
description: "Name of the user",
type: llm.ToolParameterType.STRING
})
]
});
...
// Add additional code