N/llm Module Members
Explore N/llm module members in SuiteScript, including chat messages, documents, and responses for AI integration.
TL;DR Opening
The N/llm module in SuiteScript provides developers with various members, such as llm.ChatMessage and llm.Response, essential for integrating AI capabilities into applications. These members facilitate creating chat messages, handling citations, and processing responses from large language models (LLMs).
What Are N/llm Module Members?
The N/llm module members include a range of objects, methods, and enums utilized for server-side scripting in NetSuite. These members help in processing chat messages, generating responses from LLMs, and integrating AI functionalities seamlessly.
Object Members
The following table lists the key object members available in the N/llm module:
| Member Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
llm.ChatMessage | Object | Server scripts | Represents a chat message. |
llm.Citation | Object | Server scripts | Represents a citation returned from the LLM. |
llm.Document | Object | Server scripts | Used as source content when calling the LLM. |
llm.EmbedResponse | Object | Server scripts | Returns the embeddings response from the LLM. |
llm.Response | Object | Server scripts | Represents the response returned from the LLM. |
llm.StreamedResponse | Object | Server scripts | Represents the streamed response returned from the LLM. |
llm.Tool | Object | Server scripts | Represents a tool requested by the LLM. |
llm.ToolCall | Object | Server scripts | Represents a tool call request from the LLM. |
llm.ToolParameter | Object | Server scripts | Represents a parameter for a tool. |
llm.ToolResult | Object | Server scripts | Represents a tool result sent back to the LLM. |
Method Members
The N/llm module also includes various methods essential for creating and managing LLM functionality. Here’s a summary of key methods:
| Method Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
llm.createChatMessage(options) | llm.ChatMessage | Server scripts | Creates a chat message based on specified role and text. |
llm.createDocument(options) | llm.Document | Server scripts | Creates a document for use as source content for the LLM. |
llm.createTool(options) | llm.Tool | Server scripts | Creates a tool that the LLM can request. |
llm.embed(options) | llm.EmbedResponse | Server scripts | Returns embeddings from the LLM for a given input. |
llm.generateText(options) | llm.Response | Server scripts | Generates a response from the LLM based on a provided prompt. |
llm.getRemainingFreeUsage() | Number | Server scripts | Returns the number of free requests available in the month. |
Enum Members
Enum members in the N/llm module help set various configuration options in your functions:
| Enum Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
llm.ChatRole | enum | Server scripts | String values for roles of chat message authors. |
llm.ModelFamily | enum | Server scripts | String values for large language model configurations. |
llm.SafetyMode | enum | Server scripts | Configurations for safety modes in LLM requests. |
Who This Affects
The content of this article is relevant for:
- Developers implementing AI functionalities in applications.
- NetSuite Administrators who oversee script configurations and updates.
- Scripting Teams utilizing server-side capabilities of SuiteScript.
Key Takeaways
- The N/llm module provides various members for effective AI integration in applications.
- Key members include objects, methods, and enums necessary for generating chats and processing responses.
- Understanding how to utilize these members can significantly enhance application functionality with AI capabilities.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
What script types are supported by the N/llm module members in SuiteScript?
How can I create a chat message using the N/llm module in SuiteScript?
What is the use of the `llm.Document` object in the N/llm module?
How can developers manage usage limits with the N/llm module?
Was this article helpful?
More in Integration
- Natural Language Queries in NetSuite AI
MCP Standard Tools SuiteApp enables AI-driven data tasks in NetSuite, aligned with role permissions.
- Square Connector Integration in NetSuite 2026.1
Discover the Square Connector for seamless integration with NetSuite 2026.1, synchronizing transactions, orders, and inventory effortlessly.
- SuiteTalk Web Services Updates for NetSuite Integrations
SuiteTalk Web Services adds new Item Supply Plan support, enhancing integrations for efficient data management.
- SuiteTalk Web Services Enhancements in NetSuite
Explore the latest enhancements to SuiteTalk Web Services, improving integration and API functionalities in NetSuite.
Advertising
Reach Integration Professionals
Put your product in front of NetSuite experts who work with Integration every day.
Sponsor This Category