Unlocking AI in NetSuite - Key Features and Native LLM Capabilities
NetSuite has been actively incorporating Large Language Models (LLMs) and other AI capabilities into its platform. Here are some of the Key Features and Initiatives;
Text Enhance: This built-in feature uses generative AI to help users create and refine content within NetSuite. It can assist with writing item descriptions, job descriptions, and other text-based content, saving time and improving consistency. ?
NetSuite SuiteAnalytics Assistant: This assistant uses generative AI to help users retrieve information from their NetSuite data and generate reports using natural language queries. ?
Prompt Studio: This tool allows administrators and developers to fine-tune the output of AI-generated content, ensuring it aligns with specific needs and preferences.
NetSuite Financial Exception Management: This AI-powered tool automatically detects financial anomalies, helping businesses identify and address potential issues quickly.
SuiteScript Generative AI APIs: These APIs allow developers to integrate LLMs into NetSuite customizations and SuiteApps. This means you can build AI-powered functionalities like report generation, data summarization, and natural language processing directly within NetSuite.
/**
*@NApiVersion 2.1
*/
// This example shows how to send a Prompt to the LLM and Receive a Response
require(['N/llm'],
function(llm) {
const response = llm.generateText({
// modelFamily is optional. When omitted, the Cohere Command R model is used.
// To try the Meta Llama model, remove the uncomment the line below
// modelFamily: llm.ModelFamily.META_LLAMA,
prompt: "Hello World!",
modelParameters: {
maxTokens: 1000,
temperature: 0.2,
topK: 3,
topP: 0.7,
frequencyPenalty: 0.4,
presencePenalty: 0
}
});
const responseText = response.text;
// View remaining monthly free usage
const remainingUsage = llm.getRemainingFreeUsage();
});
NetSuite leverages Oracle Cloud Infrastructure (OCI) and its Generative AI services to power these AI capabilities. It ensures that customer data remains secure and private within the OCI environment.
SuiteScript Integration to External LLMs: NetSuite can also integrate with external LLMs via APIs. For example, here is a sample code using SuiteScript to interact with a Hugging Face LLM model through their Inference API:
领英推荐
/**
* @NApiVersion 2.1
* @NScriptType Suitelet
*/
define(['N/https', 'N/log', 'N/url'], function(https, log, url) {
/**
* Definition of the Suitelet script.
* @param {Object} context - Contains request and response objects.
*/
function onRequest(context) {
if (context.request.method === 'GET') {
let form = context.form;
form.title = 'Hugging Face LLM Example';
form.addField({
id: 'custpage_input',
type: 'textarea',
label: 'Enter your text here'
});
form.addSubmitButton({
label: 'Generate Text'
});
context.response.writePage(form);
} else if (context.request.method === 'POST') {
let inputText = context.request.parameters.custpage_input;
if (inputText) {
// Replace with your actual Hugging Face API key and model endpoint
let hfApiKey = 'YOUR_HUGGING_FACE_API_KEY';
// Example model
let modelEndpoint = 'https://api-inference.huggingface.co/models/gpt2';
let response = https.post({
url: modelEndpoint,
headers: {
'Authorization': 'Bearer ' + hfApiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"inputs": inputText
})
});
if (response.code === 200) {
let generatedText = JSON.parse(response.body);
log.debug('Generated Text', generatedText);
let form = context.form;
form.title = 'Generated Text';
form.addField({
id: 'custpage_output',
type: 'textarea',
label: 'Generated Text',
defaultValue: JSON.stringify(generatedText)
});
context.response.writePage(form);
} else {
log.error('API Error', 'Failed to generate text: ' + response.body);
context.response.write('Error: Failed to generate text.');
}
}
}
}
return {
onRequest: onRequest
};
});
Advantages of NetSuite's N/llm Module versus Integration to External LLM:
Disadvantages or Considerations:
In summary, NetSuite is actively embracing LLMs and AI to enhance its platform and provide users with powerful tools to improve efficiency, decision-making, and overall productivity. The new LLM capabilities lets developers integrate generative AI models into NetSuite customizations and SuiteApps. Additionally, Oracle Code Assist - a code generation tool powered by LLM running on Oracle Cloud Infrastructure will be made available to assist NetSuite developers. It has the capability to generate, test, analyze, and explain code, delivering a major productivity boost.
Resources:
#LLM#GenerativeAI#AI#NetSuite
Business Development Manager at Business Solution Partners
1 个月Thanks, Hussain!
CEO at BSP
1 个月Great post, Hussain! It's exciting to see NetSuite's AI features evolving. As businesses look into these new capabilities, it's key to know how to use them effectively and weigh the tradeoffs of built-in versus external AI solutions.
Helping companies scale through NetSuite
1 个月Very insightful, Hussain! Thank you!