Imagine a custom step in a SAS Studio flow that generates another custom step to handle specific tasks. A custom step is a file, therefore why not use a large language model (LLM) like GPT-4o from Azure OpenAI to generate one? Today, we’ll explore how to leverage this technology to create custom steps for data processing, using Python or SAS logic.
The LLM - Custom Step Generator is a custom step that uses Azure OpenAI's GPT-4o to create fully functional custom steps. These steps can be used in SAS Studio flow to perform specific tasks, such as data anonymization, merging tables, or generating detailed documentation.
The custom step has been published to the SAS Studio Custom Steps Public GitHub Repository. You can find it under LLM - Custom Step Generator with Azure OpenAI.
The process is simple:
The result? A fully functional custom step tailored to your specific requirements.
Watch the video demonstration to find out more.
You have a text file containing sensitive personal information, such as names, email addresses, and physical addresses. Your goal is to anonymize this data using a custom step.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
Create a custom step that reads an input file containing PIIs, identifies the data containing PIIs and anonymizes it. 1. input is a csv file input.csv. 2. output is output.csv. 3. the logic is written in Python. Provide the Prompt UI, the program and the full step file.
Example:
AZURE_OAI_ENDPOINT='https://my_endpoint.openai.azure.com/' # change my_endpoint
AZURE_OAI_KEY='my_api_key' # change my_api_key
AZURE_OAI_DEPLOYMENT='gpt-4o'
The custom step successfully anonymized the text file by replacing sensitive information with hashed values or other anonymized strings. The process demonstrated the accuracy of the LLM in generating Python logic based on the provided instructions.
You need to perform classic data management tasks, such as merging two tables, calculating the top-selling product per month, and creating a summary table of top products.
Create a custom step using SAS logic. The step has two table inputs, for example SASDM.PRDSAL2 and SASDM.PRDSAL3. The logic will merge the two tables. Then it will summarize the product sales by YEAR, MONTH, PRODUCT and sum up the ACTUAL sales. It will then create another data set NATIONAL_SALES in SASDM listing by YEAR, MONTH create a new column CHAMPION_PRODUCT equal with the top selling product.
Execute the generator with the updated prompt.
The custom step successfully merged the tables, calculated the top-selling products, and created the summary table. The SAS logic was accurate and aligned with the prompt instructions.
To replicate these examples, ensure you have the following:
The custom step is in the process of being published to the LLM - Custom Step Generator with Azure OpenAI, SAS Studio Custom Steps Public GitHub Repository. We will publish an update when it's done. Thank you for your patience.
The ability to generate custom steps using Azure OpenAI GPT-4o opens up new possibilities for data management, automation, and innovation. Whether you’re anonymizing data, managing tables, or documenting workflows, the LLM - Custom Step Generator provides a powerful and flexible solution.
The examples presented here are just the beginning—what custom steps will you create next?
Thank you for exploring this exciting technology with me. Stay tuned for more innovations in Data Management with SAS Viya.
Thank you for your time reading this post. If you liked the post, give it a thumbs up! Please comment and tell us what you think about the LLM custom step generator. If you wish to get more information, please write me an email.
Find more articles from SAS Global Enablement and Learning here.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.