Skip to content

Steps to Create Intelligent Scenarios

  1. Open the browser and navigate to the Fiori Launchpad by clicking here. We've already kept the system logged in. And under "Analytics" tab launch the "Intelligent Scenarios" application. Intelligent Scenarios

  2. Click the Create button and choose Side-by-Side. Intelligent Scenarios

  3. Next, go to the Settings tab and select Generative AI as the Scenario Type.
    Intelligent Scenarios

  4. Enter unique Scenario name in the below format, where ## is your attendee ID.

    Z_POL_DOC_SUMM_##
    
    Intelligent Scenarios

  5. Enter the description

    Summarize Return Policy Document
    
    Intelligent Scenarios

  6. Select Stateless – Customer as the Usage Type.
    This option provide the shared connectivity model allows a single connection between the ABAP system and the SAP Generative AI Hub to be configured once and reused across multiple AI use cases. This simplifies administration, improves governance, and reduces setup effort. Reuse connectivity is already set up and no action is required here for connectivity. Intelligent Scenarios

  7. Add a Generative AI model to the Intelligent Scenario by selecting Add Model and providing the required details.
    Intelligent Scenarios

  8. Enter the below details:

  9. Model name as Z_POL_DOC_SUMMARIZE_MOD
  10. Description as Model with orchestration modules
    Intelligent Scenarios

  11. Select the appropriate Executable ID from the drop down. In this case, we will choose azure-openai
    Intelligent Scenarios

  12. Select the corresponding Model from the drop down. In this exercise, we will choose gpt-5-mini
    Intelligent Scenarios

  13. Optionally, choose a specific Model Version (latest is selected by default). In this case, we can keep as empty to have latest.
    Intelligent Scenarios

  14. Choose Add to confirm
    Intelligent Scenarios

  15. Intelligent scenario with Orchestration service:

  16. Navigate to the Execution Flow Template
  17. Upload the Execution Flow Template
  18. Click the Upload button.
  19. Locate the Orchestration config folder on your desktop.
  20. Open the config_json.txt file to view the orchestration configuration JSON.
  21. Either select all and copy the JSON, or paste the below JSON directly into the dialog.
    {
      "module_configurations": {
        "grounding_module_config": {
          "type": "document_grounding_service",
          "config": {
            "filters": [
              {
                "id": "filter1",
                "data_repositories": [
                  "2a35766b-e72e-4ef8-9223-5995c839b1cd"
                ],
                "search_config": {
                  "max_document_count": 0
                },
                "data_repository_type": "vector"
              }
            ],
            "input_params": [
              "grounding_input_variable_1"
            ],
            "output_param": "grounding_output_variable"
          }
        },
        "llm_module_config": {
          "model_name": "gpt-5-mini",
          "model_params": {},
          "model_version": {}
        },
        "templating_module_config": {
          "template_ref": {}
        },
        "filtering_module_config": {
          "input": {
            "filters": [
              {
                "type": "azure_content_safety",
                "config": {
                  "Hate": 0,
                  "SelfHarm": 0,
                  "Sexual": 0,
                  "Violence": 0
                }
              },
              {
                "type": "llama_guard_3_8b",
                "config": {
                  "child_exploitation": true,
                  "code_interpreter_abuse": true,
                  "defamation": true,
                  "elections": true,
                  "hate": true,
                  "indiscriminate_weapons": true,
                  "intellectual_property": true,
                  "non_violent_crimes": true,
                  "privacy": true,
                  "self_harm": true,
                  "sex_crimes": true,
                  "sexual_content": true,
                  "specialized_advice": true,
                  "violent_crimes": true
                }
              }
            ]
          },
          "output": {
            "filters": [
              {
                "type": "azure_content_safety",
                "config": {
                  "Hate": 0,
                  "SelfHarm": 2,
                  "Sexual": 4,
                  "Violence": 6
                }
              },
              {
                "type": "llama_guard_3_8b",
                "config": {
                  "child_exploitation": true,
                  "code_interpreter_abuse": true,
                  "defamation": true,
                  "elections": true,
                  "hate": true,
                  "indiscriminate_weapons": true,
                  "intellectual_property": true,
                  "non_violent_crimes": true,
                  "privacy": true,
                  "self_harm": true,
                  "sex_crimes": true,
                  "sexual_content": true,
                  "specialized_advice": true,
                  "violent_crimes": true
                }
              }
            ]
          }
        },
        "masking_module_config": {
          "masking_providers": [
            {
              "type": "sap_data_privacy_integration",
              "method": "anonymization",
              "entities": [
                {
                  "type": "profile-email"
                },
                {
                  "type": "profile-gender"
                },
                {
                  "type": "profile-pronouns-gender"
                },
                {
                  "type": "profile-location"
                },
                {
                  "type": "profile-person"
                },
                {
                  "type": "profile-url"
                }
              ],
              "mask_grounding_input": {
                "enabled": true
              },
              "allowlist": [
                "ANALYTICS",
                "SPECIALIST"
              ]
            }
          ]
        },
        "input_translation_module_config": {},
        "output_translation_module_config": {}
      }
    }
    
    Intelligent Scenarios
  22. Once a valid JSON is uploaded, the modules will be displayed with their parameters and values in display mode.

  23. In the Grounding subsection, add the required data repository type Vector. This will support the grounding document addition.
    Intelligent Scenarios
    To restrict your grounding module output during inference, maintain Search Configuration value. This can help to retrieve only relevant data instead of all the uploaded data.
    Intelligent Scenarios

  24. The Input Translation module allows you to translate LLM text prompts and grounding module output into a target language. It may help improve LLM response when the configured model performs better with input in specific language, example English. In this use case, prompt texts are already English, so no need to maintain the Input translation configuration.
    Also, Prompt Shield is already true as per the JSON configuration file.
    Intelligent Scenarios

  25. The Data Masking module enables the anonymization or pseudonymization of data before it is sent to the LLM model for processing.
    The Input filters defined in the Execution Flow Template JSON are populated and displayed in the table. Intelligent Scenarios

  26. The Output Filtering module allows you to filter the harmful or hateful content generated by the LLM.
    The Output Translation module allows you to translate LLM response into a target language. It helps to display the LLM response in the language user logged, if the translation is supported.
    Intelligent Scenarios

  27. Add Prompt & Grounding Template

  28. Add a Grounding Template with name GROUNDING_TEMPLATE with description Grounding query and then add the below Grounding template text.
    {ISLM_GROUNDING_QUERY}
    
  29. Select the Display template information as Yes. The grounding template can include dynamic parameters similar to the user prompt.
  30. The Grounding Template retrieves relevant information from the selected data repository and appends it to the user prompt. It supports dynamic parameters, which are provided at runtime (during inference).
    Intelligent Scenarios Intelligent Scenarios

  31. Add Prompt template for System prompt
    Intelligent Scenarios

  32. Enter the prompt name SYSTEM_PROMPT. The system prompt is used to set the overall context, behavior, or persona for the AI's responses. It provides the fundamental instruction set to guide the model's behaviour throughout an interaction.
  33. Enter the description Explain the role and responsibility for the LLM
  34. Select the Display template information as Yes.
    Enter the below text as Prompt text: You are {ISLM_ROLE}. Your responsibility is to {ISLM_RESPONSIBILITY}.
  35. Default parameter value of ISLM_ROLE: An helpful assistant.
  36. Default parameter value of ISLM_RESPONSIBILITY: Assist the user with their queries. Intelligent Scenarios

  37. Add Prompt template for User prompt

  38. Enter the prompt name: SUMMARIZE_RETURN_POLICY
  39. Enter the description Use LLM to summarize the return policy document to populate standard JSON
  40. Select the Display template information as Yes.
  41. Enter the below text as Prompt text

    Generate a summary of return policy document provided below for the company {ISLM_COMPANY_NAME}.
    
    ### INSTRUCTIONS
    - Populate the conditions of the return policy in the following JSON format
    {
      "return_policy": {
        "overview": {
          "summary": "string",
          "free_returns": "boolean",
          "customer_friendly_notes": "string"
        },
        "return_window": {
          "days": "integer",
          "from_date": "string", // e.g., "from delivery date" or "from purchase date"
          "extensions": ["string"] // e.g., ["holidays", "defective items"]
        },
        "eligibility_criteria": {
          "conditions": ["string"], // e.g., ["unused", "original packaging", "with tags"]
          "proof_of_purchase": {
            "required": "boolean",
            "alternatives": ["string"] // e.g., ["order history", "email confirmation"]
          },
          "item_condition": "string" // e.g., "unworn, unwashed"
        },
        "non_returnable_items": {
          "categories": ["string"], // e.g., ["software", "undergarments", "perishables", "custom products", "final sale"]
          "reasons": ["string"]
        },
        "return_process": {
          "initiation_methods": ["string"], // e.g., ["online portal", "email support", "phone", "in-store"]
          "steps": ["string"],
          "return_authorization": {
            "required": "boolean",
            "form_url": "string",
            "label_provided": "boolean"
          },
          "shipping": {
            "who_pays": "string", // e.g., "customer", "merchant", "prepaid label"
            "instructions": "string",
            "address": "string",
            "preferred_carriers": ["string"]
          },
          "required_documents": ["string"] // e.g., ["receipt", "order number", "packing slip"]
        },
        "refund_options": {
          "types": ["string"], // e.g., ["full refund", "partial refund", "store credit", "exchange"]
          "default_method": "string",
          "payment_method": "string", // e.g., "original payment", "gift card"
          "processing_time": "string", // e.g., "3-5 business days"
          "fees": {
            "restocking_fee": {
              "amount": "number",
              "percentage": "number",
              "applies_to": ["string"]
            },
            "other_fees": ["string"]
          }
        },
        "shipping_costs": {
          "original_shipping": "boolean", // refundable?
          "return_shipping": "boolean" // refundable?
        },
        "special_cases": {
          "defective_damaged": {
            "extended_window": "boolean",
            "free_shipping": "boolean",
            "full_refund": "boolean"
          },
          "wrong_item": {
            "process": "string"
          },
          "holidays": "boolean",
          "other": ["string"]
        },
        "contact_info": {
          "support_email": "string",
          "phone": "string",
          "live_chat": "boolean",
          "return_center_url": "string"
        },
        "legal_notes": {
          "state_laws": ["string"],
          "warranties": "string"
        },
        "last_updated": "string" // for policy version tracking
      }
    }
    
    - Respond with only the JSON output
    
    ### RETURN POLICY DOCUMENT
    {ISLM_GROUNDING_OUTPUT}
    

  42. If you have configured grounding module, at least one User Prompt must be added with the following parameter: {ISLM_GROUNDING_OUTPUT}
    At runtime, this placeholder is automatically replaced with the content retrieved by the Grounding Template from the configured data repository.
    Intelligent Scenarios Intelligent Scenarios

  43. Save Draft
    Intelligent Scenarios

  44. Navigate to Scenario documents section by pressing Back
    Intelligent Scenarios

  45. Upload grounding documents to an Intelligent Scenario
    Intelligent Scenarios

  46. Press Upload button
    Intelligent Scenarios

  47. Select the below files from the Grounding files folder in your desktop
    Intelligent Scenarios

  48. Enter the document names like below and choose English as language for all the files.
    Intelligent Scenarios

  49. Click Publish button and enter the package as local object $TMP Intelligent Scenarios

  50. Press OK
    Intelligent Scenarios

Intelligent Scenario is created successfully.