SuiteScript 2.1 Generative AI APIs
The content in this help topic pertains to SuiteScript 2.1.
SuiteScript Generative AI APIs (N/llm Module) let you work with generative artificial intelligence (AI) in NetSuite using SuiteScript. You can use these APIs to send requests to large language models (LLMs) and to receive responses from them. NetSuite accesses LLMs through an integration with the Oracle Cloud Infrastructure (OCI) Generative AI service.
To learn about other generative AI capabilities that NetSuite offers, see NetSuite Features That Use AI.
As you work with SuiteScript Generative AI APIs, keep the following considerations in mind:
-
Generative AI features, such as the N/llm module, use creativity in their responses. Make sure you validate the AI-generated responses for accuracy and quality. Oracle NetSuite isn't responsible or liable for the use or interpretation of AI-generated content.
-
SuiteScript Generative AI APIs (N/llm module) are available only for accounts located in certain regions. For a list of these regions, see Generative AI Feature Availability in NetSuite.
How the SuiteScript Generative AI APIs Work
-
A NetSuite developer uses the N/llm module in their SuiteScript code to send a request to the LLM.
-
NetSuite accepts the prompt and any optional parameters included in the request and passes them to the OCI Generative AI service.
-
The OCI Generative AI service processes the request using the LLM specified in your code. If you don't specify the LLM, the service uses the Cohere Command A model. The data is not used by third parties for model training.
Note:When you use the N/llm module, your data may be processed globally according to the Oracle Services Privacy Policy.
-
The OCI Generative AI service sends the LLM response back to NetSuite.
-
NetSuite processes the response and returns it to the SuiteScript code.
-
The SuiteScript code uses the response per the rest of the script.
Supported LLMs
The generateText and generateTextStreamed methods have a modelFamily parameter that you can use to specify the LLM used, and a modelParameters object that lets you send supported parameters to the LLM with your prompt. For a list of supported models, see llm.ModelFamily. For more information about model parameters, see Model Parameter Values by LLM. If your code doesn't specify the model to use (through the modelFamily parameter), the Cohere Command A model is used.
For more information about chat model parameters in general, refer to Offered Pretrained Foundational Models in Generative AI in the Oracle Cloud Infrastructure Documentation.
The evaluatePrompt and evaluatePromptStreamed methods take an existing prompt, along with values for any variables that the prompt uses, and send it to the LLM. You can use Prompt Studio to specify the model family that each prompt uses. For more information, see Prompt Studio.
SuiteScript API Governance Limits for N/llm
The N/llm module is subject to SuiteScript API governance limits. The governance limits are included in individual method topics. For more information, see SuiteScript Governance and Limits and SuiteScript 2.1 API Governance.