Data 360 SQL and Tableau Hyper API
AI_CLASSIFY
AI_GENERATE_TEXT
AI_SENTIMENT
Type Conversions
Logical Operators
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
AI_GENERATE_TEXT (Beta)Applies to: ✅ Data 360 SQL ❌ Tableau Hyper API
AI_GENERATE_TEXT is a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer’s sole discretion.
Note
Calls the Nemotron 3 Nano 30B (Beta) large language model (LLM) in a Data 360 SQL query to generate or summarize text. The function returns generated text for each row of data. To get started with this function in beta, turn on Beta Generative AI Models. To find this beta feature: under Platform Tools in Setup, go to Einstein, then to Einstein Generative AI, and then to Einstein Setup.
1ai_generate_text(<input_prompt>)input_prompt: The text prompt sent to the model. This can be a column, a literal, or an expression that composes a prompt from other columns (for example, by using the string concatenation operator).Returns generated text for each row according to the input prompt. A language model generates the output, so the same prompt can produce different text on different runs.
ORDER BY with LIMIT to cap the number of rows sent to the model.input_prompt must be a non-NULL value. Add NON_NULL to the WHERE clause in your SQL statement to avoid NULL value errors.Generate text from a single prompt.
1SELECT ai_generate_text(input_prompt => 'Write a one-sentence thank-you note to a customer.') AS generated_textReturns the generated text for the prompt.
Generate a short summary of customer feedback for each row in a table.
1SELECT
2 "customerServiceFeedback__c",
3 ai_generate_text('Summarize this customer feedback in one sentence: ' || "customerServiceFeedback__c") AS summary
4FROM "AutomobileServiceFeedback__dll"
5ORDER BY "date__c"
6DESC LIMIT 10This example builds the prompt for each row with the string concatenation operator (||). The operator joins the fixed instruction text, 'Summarize this customer feedback in one sentence: ', to the value in the customerServiceFeedback__c column, so each row sends its own feedback text to the model as part of the prompt.
Returns a one-sentence summary of the feedback for each row.
Compose a prompt from identity, purchase, and service fields on a unified profile to generate a short brief for sales or service users.
1SELECT
2 "Id__c",
3 ai_generate_text(
4 'Write a two-sentence customer brief from these details. Name: ' || "FirstName__c" || ' ' || "LastName__c" ||
5 '. Loyalty tier: ' || "LoyaltyTier__c" ||
6 '. Last purchase category: ' || "LastPurchaseCategory__c" ||
7 '. Recent service issue: ' || "LastCaseSummary__c"
8 ) AS profile_brief
9FROM "UnifiedIndividual__dlm"
10ORDER BY "LastActivityDate__c" DESC
11LIMIT 25This example uses the string concatenation operator (||) to build a prompt from several profile fields, so the model generates a personalized brief for each customer. ORDER BY with LIMIT keeps the query within the 30-second timeout by capping how many rows are sent to the model.