Tooling Support for N/llm Module in SuiteScript
The N/llm module adds tooling support in SuiteScript, enabling custom tools for enhanced LLM interactions.
TL;DR Opening
The N/llm module in SuiteScript introduces tooling support that allows developers to create custom tools for enhanced interactions with large language models (LLMs). These tools can facilitate complex business logic and improve the accuracy of the model's responses by integrating dynamic outputs.
What is the N/llm Module?
The N/llm module in SuiteScript 2.1 enables developers to extend the capabilities of LLM interactions within NetSuite. By defining custom tools, businesses can enhance LLM functionalities to accommodate specific use cases and requirements.
What New Tools Have Been Introduced?
The N/llm module now supports various new topics and sections:
- Tooling in the N/llm Module: General overview of the module's tooling capabilities.
- Creating Tool Definitions: The ability to create custom tools using the
llm.createTool(options)method, allowing LLMs to invoke them during interactions. - Tool Parameters: Defining parameters for these tools using
llm.createToolParameter(options). - Tool Results: Managing result outputs through
llm.createToolResult(options). - Tool Calls: Handling execution requests with
llm.ToolCall.
How Do Custom Tools Work?
Creating Tool Definitions
To create custom tools, follow these steps:
- Define your tool using the
llm.createTool(options)method. - Provide a unique identifier and description to help the LLM understand tool usage.
- Create associated tool handlers that implement the specific logic needed for the tool's operation.
- Besides core functionalities, tools can execute SuiteQL queries or perform business logic, enriching the overall interaction.
Integrating Tools into LLM Responses
Once custom tools are defined, they can be integrated into LLM responses. When using the llm.generateText(options) method, you can specify these tools in the options.tools parameter. The LLM determines when to employ a tool based on the prompts it receives and the context of previous interactions:
- The LLM analyzes the conversation history and prompt information.
- If it identifies a need for additional processing, it requests a tool call.
- Tool results are processed and can potentially lead to further tool calls as needed during the interaction.
Streaming Support
The llm.generateTextStreamed(options) method also supports tool integration, allowing for real-time processing and tool call handling.
Who This Affects
- Developers: Those building custom SuiteScripts to enhance NetSuite functionality.
- Administrators: Individuals managing LLM configurations and tooling definitions within NetSuite.
Key Takeaways
- The N/llm module now supports custom tooling for advanced LLM interactions.
- Developers can create and define tools to augment LLM responses.
- Integration facilitates dynamic tool calls during LLM operations, enhancing accuracy.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Does the N/llm module require a specific version of SuiteScript to work?
How do I define parameters for custom tools in the N/llm module?
Can I integrate custom tools with real-time LLM responses?
What role do administrators have concerning the N/llm module?
Was this article helpful?
More in SuiteScript
- Scheduling Map/Reduce Script Submissions in NetSuite
Learn how to schedule map/reduce scripts for one-time or recurring submissions in NetSuite, enhancing automation and efficiency.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- Attach and Detach Operations in NetSuite 2026.1
Attach and detach operations for record relationships in NetSuite enhance data management and connectivity.
