Tooling Support for N/llm Module in SuiteScript

The N/llm module adds tooling support in SuiteScript, enabling custom tools for enhanced LLM interactions.

·2 min read·View Oracle Docs

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:

  1. Define your tool using the llm.createTool(options) method.
  2. Provide a unique identifier and description to help the LLM understand tool usage.
  3. Create associated tool handlers that implement the specific logic needed for the tool's operation.
  4. 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:

  1. The LLM analyzes the conversation history and prompt information.
  2. If it identifies a need for additional processing, it requests a tool call.
  3. 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?
The N/llm module requires SuiteScript 2.1 to enable developers to extend LLM functionalities within NetSuite.
How do I define parameters for custom tools in the N/llm module?
Parameters for custom tools are defined using the `llm.createToolParameter(options)` method, which is part of the tooling support provided by the N/llm module.
Can I integrate custom tools with real-time LLM responses?
Yes, you can integrate custom tools with real-time LLM responses using the `llm.generateTextStreamed(options)` method, which supports tool integration for live processing.
What role do administrators have concerning the N/llm module?
Administrators manage LLM configurations and tooling definitions within NetSuite, ensuring that the custom tools and interactions are properly set up and maintained for enhanced LLM functionality.
Source: SuiteScript Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in SuiteScript

View all SuiteScript articles →