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

  1. Navigate back to the decision service.
  2. Open the overflow menu of the Part number decision model and delete it.
  3. Click Create +.
  4. Select Generative AI and enter Part number as the name.
  5. Click Create.

    The generative AI model opens automatically.

  6. 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.

  7. 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
  8. Clear the default prompt input and enter: what is the part number of {{product}}?

    A warning is displayed because the product variable has not been defined yet.

  9. Under Variables, edit the default variable:
    1. Double-click variable and change the variable name to product.
    2. Set its default value to laptop.
  10. Click Generate to test your model.
  11. 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

  1. Navigate back to the decision service.
  2. Open the [Main] Pricing decision model.

    It shows an error because it uses the Part number decision model that you deleted in Step 1.

  3. Remove the Part number function node.
  4. Create a Generative AI node and select Part number in the Generative AIs drop-down menu.
  5. Connect the Part number node to the Products decision node.
  6. Select the Products decision node.
  7. 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
  8. The model is now error-free and can be run:
    1. Go to the Run tab.
    2. 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.

Learn more