N/llm Module Members for AI Integration in SuiteScript
N/llm module members crucial for AI integration in SuiteScript, including chat messages, documents, and responses.
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.
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 AI
- Enhanced Natural Language Queries with MCP Standard Tools
Discover how MCP Standard Tools enhance natural language queries in NetSuite AI for version 2026.1.
- Intelligent Close Manager Portlet in NetSuite
The Intelligent Close Manager portlet centralizes task and exception management in NetSuite, improving close processes.
- New Role Setup for NetSuite AI Connector Service in 2026.1
Updated to include 2026.1 details on role setup and prerequisites for NetSuite AI Connector Service.
- Predict Invoice Payment Dates Using AI in NetSuite
NetSuite's Payment Date Prediction leverages machine learning to forecast invoice payment dates for better financial planning.
Advertising
Reach AI Professionals
Put your product in front of NetSuite experts who work with AI every day.
Sponsor This Category