Task 2: Creating a generative AI model and integrating it into a decision model
You create a generative AI model to identify the correct product part number from a
product name, and integrate it into a decision model to automatically generate accurate part numbers
during pricing decisions.
Step 1: Creating a generative AI model
- Navigate back to the decision service.
- Open the overflow menu of the Part number decision model and delete it.
- Click Create +.
- Select Generative AI and enter Part number as the name.
- Click Create.
The generative AI model opens automatically.
- Select the meta-llama/llama-3-3-70b-instruct foundation model in the
Model drop-down menu.
You can explore and test other foundation models to see which one consistently returns the results you would expect.
- Clear the Context pane and enter the following
input:
Your goal is to find the part number of a product, based on its name, which can be singular or plural. If you don't find it, just answer N/A. Write only one part number. Here is the list of products and part numbers: Part Number,Product Name (English) OF-001,Ergonomic Office Chair OF-002,Executive Desk OF-003,Conference Table OF-004,Filing Cabinet OF-005,Office Cubicle OF-006,Desk Lamp OF-007,Standing Desk OF-008,Office Sofa OF-009,Reception Desk OF-010,Bookcase OF-011,Meeting Room Chair OF-012,Office Partition OF-013,Monitor Stand OF-014,Keyboard Tray OF-015,Desk Organizer OF-016,Office Pod OF-017,Printer Stand OF-018,Office Stool OF-019,Whiteboard OF-020,Bulletin Board OF-021,Coat Rack OF-022,Office Plant OF-023,Laptop Stand OF-024,Side Table OF-025,Office Chair Mat OF-026,Footrest OF-027,Desktop Computer OF-028,Laptop OF-029,Monitor OF-030,Mouse, OF-031,Keyboard OF-032,Printer OF-033,Scanner OF-034,Fax Machine OF-035,Shredder OF-036,Phone OF-037,Projector OF-038,Projector Screen OF-039,Server Rack, OF-040,Network Switch OF-041,Office Safe OF-042,File Sorter OF-043,Pen Holder OF-044,Paper Tray OF-045,Waste Bin OF-046,Recycle Bin OF-047,Coffee Maker OF-048,Water Dispenser OF-049,Mini Fridge OF-050,Microwave OF-051,Desk Fan OF-052,Air Purifier OF-053,Heater OF-054,Electric Kettle OF-055,Clock OF-056,Picture Frame OF-057,Desk Drawer Organizer OF-058,Cushion OF-059,Blanket OF-060,Desk Calendar OF-061,Planner OF-062,Note Pad OF-063,Sticky Notes OF-064,Paper Clips OF-065,Stapler OF-066,Staples OF-067,Tape Dispenser OF-068,Scissors OF-069,Ruler OF-070,Hole Punch OF-071,Label Maker OF-072,Calculator OF-073,Binder OF-074,File Folder OF-075,Clipboard OF-076,Desk Pad OF-077,Cable Organizer OF-078,Extension Cord OF-079,Power Strip OF-080,USB Hub OF-081,Charging Station OF-082,Pen OF-083,Pencil OF-084,Highlighter OF-085,Marker OF-086,Eraser OF-087,Whiteboard Marker OF-088,Dry Erase Eraser OF-089,Rubber Bands OF-090,Thumbtacks OF-091,Push Pins OF-092,Desk Mirror OF-093,Desk Clock OF-094,Table Lamp OF-095,Magazine Rack OF-096,Office Signage OF-097,Paperweight OF-098,Visitor Chair OF-099,Guest Sofa OF-100,Desk Lamp - Clear the default prompt input and enter:
what is the part number of {{product}}?A warning is displayed because the
productvariable has not been defined yet. - Under Variables, edit the default variable:
- Double-click variable and change the variable name to product.
- Set its default value to laptop.
- Click Generate to test your model.
- Update the default variable again, using laptops or
Laptop.
The generated output is always
OF-028.
Step 2: Integrating the generative AI model into a decision model
- Navigate back to the decision service.
- Open the [Main] Pricing decision model.
It shows an error because it uses the Part number decision model that you deleted in Step 1.
- Remove the Part number function node.
- Create a Generative AI node and select Part number in the Generative AIs drop-down menu.
- Connect the Part number node to the Products decision node.
- Select the Products decision node.
- Go to the Logic tab and edit the get the list of
products rule. Update lines 14 and 15 to use the Part number
generative AI model instead of the Part number decision model to define
part number:- define 'part number' as generated_text of the part number computed from product being name - The model is now error-free and can be run:
- Go to the Run tab.
- Test the [Main] Pricing decision model with the two test data sets.
The same result is returned with both data sets, showing that you fixed the limitation discovered in Task 1.