### Start UI5 App from Build Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/app/ui/README.md Starts the UI5 application from the 'dist' folder after an unoptimized build. This command is used to test the deployed version locally. ```Shell npm run start:dist ``` -------------------------------- ### Install Dependencies Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/app/ui/README.md Installs project dependencies using npm or yarn. This is a prerequisite for running and building the application. ```Shell npm install ``` -------------------------------- ### Terraform Script for SAP BTP Setup Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/2-setup/0-QuickAccountSetup.md This Terraform script automates the setup of SAP BTP resources, including creating a subaccount, entitlements, service instances, and role collections. It's designed for Infrastructure-as-Code on SAP BTP and can be customized. ```Terraform resource "btp_subaccount" "example" { name = "my-subaccount" region = "eu-central-1" directory_id = "" } resource "btp_entitlement" "hana" { subaccount_id = btp_subaccount.example.id சாervice_name = "hana" சாervice_plan_name = "hdi-shared" சாuantity = 1 } resource "btp_destination" "example" { subaccount_id = btp_subaccount.example.id name = "my-destination" type = "HTTP" சாurl = "https://example.com" } resource "btp_role_collection" "example" { name = "my-role-collection" description = "Example Role Collection" subaccount_id = btp_subaccount.example.id } resource "btp_role" "example" { role_collection_name = btp_role_collection.example.name name = "Viewer" description = "View Role" subaccount_id = btp_subaccount.example.id } resource "btp_user_role_assignment" "example" { subaccount_id = btp_subaccount.example.id role_collection_name = btp_role_collection.example.name சாser_name = "user@example.com" } ``` -------------------------------- ### Run UI5 App Locally Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/app/ui/README.md Starts the UI5 application in development mode with live reloading. The app will be accessible at http://localhost:8080/index.html. ```Shell npm start ``` -------------------------------- ### Run CAP Application in Hybrid Mode Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/5-extend/2-HybridDev.md These npm scripts allow you to run the SAP CAP application in hybrid mode. 'npm run watch' monitors for changes and restarts, while 'npm run app', 'npm run ui5', and 'npm run router' can start specific services individually. ```javascript # Run in project's root folder # npm run watch # Single starts also possible npm run app # App Service npm run ui5 # SAPUI5 App npm run router # SAP Approuter ``` -------------------------------- ### Install MultiApps CF CLI Plugin Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/3-deploy/2-DeployTheApplication.md Command to install the MultiApps CF CLI Plugin, which is necessary for deploying multi-target applications to Cloud Foundry. Refer to the provided GitHub link for more details. ```sh cf install-plugin multiapps ``` -------------------------------- ### Deploy Application using npm Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/3-deploy/2-DeployTheApplication.md Command to start the application deployment process to Cloud Foundry. This command is typically found in the project's package.json file and should be run from the project's root folder. ```javascript # Run in project's root folder # npm run deploy ``` -------------------------------- ### Install Cloud MTA Build Tool (MBT) Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/3-deploy/1-BuildTheComponents.md Installs the Cloud MTA Build Tool (MBT) globally using npm. MBT is essential for building Multi-Target Application Archives (mtar) for SAP BTP. ```sh npm i -g mbt ``` -------------------------------- ### Install TypeScript Dependencies Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/3-deploy/1-BuildTheComponents.md Installs the required TypeScript development tools globally using npm. These tools include TypeScript, ts-node, and tsx for running TypeScript code. ```sh npm i -g typescript ts-node tsx ``` -------------------------------- ### Bind Service Instances using CDS CLI Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/5-extend/2-HybridDev.md This command binds essential service instances from SAP BTP Cloud Foundry to your local environment, creating necessary service keys and configuration files for hybrid testing. ```sh cds bind -2 -genai-mail-insights-hdi-container,-genai-mail-insights-uaa,-generative-ai-hub ``` -------------------------------- ### Workaround for Paketo Build Process Issue with cap-js/sqlite Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/README.md This snippet provides a workaround for an issue encountered during the paketo build process related to the 'cap-js/sqlite' package. It details how to manually install the package without saving it to project dependencies. ```bash npm i @cap-js/sqlite --no-save ``` -------------------------------- ### Get XSUAA Token Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/4-test/1-PushSampleMails.md This HTTP request retrieves an access token from the XSUAA service. It uses client credentials grant type and requires the XSUAA hostname, client ID, and client secret. ```http ### GET XSUAA TOKEN # @name getXsuaaToken POST {{xsuaaHostname}}/oauth/token Accept: application/json Content-Type: application/x-www-form-urlencoded Authorization: Basic {{btpXsuaaClient}}:{{btpXsuaaSecret}} client_id={{btpXsuaaClient}} &client_secret={{btpXsuaaSecret}} &grant_type=client_credentials ``` -------------------------------- ### Configure Application Router Default Services Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/5-extend/2-HybridDev.md This JSON configuration file specifies the authentication details (URL, Client ID, Client Secret) for the UAA service, which is required by the SAP Approuter to connect to your BTP environment. ```json { "uaa": { "url": "", "clientid": "", "clientsecret": "" } } ``` -------------------------------- ### Build UI5 App (Unoptimized) Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/app/ui/README.md Builds the UI5 application for deployment. The output is placed in the 'dist' folder. The UI5 framework is loaded from a relative URL. ```Shell npm run build ``` -------------------------------- ### Multitenant CAP Application Development on SAP BTP Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/README.md This documentation references a GitHub repository for understanding the development of a multitenant Software as a Service (SaaS) application in SAP BTP. It covers deployment in both SAP BTP, Kyma Runtime, and SAP BTP, Cloud Foundry Runtime using CAP. ```shell git clone https://github.com/SAP-samples/btp-cap-multitenant-saas.git ``` -------------------------------- ### Basic CAP GenAIhub Vector Engine Sample Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/README.md A lightweight, backend-only sample demonstrating the Reference Architecture for CAP, Generative AI Hub, and SAP HANA Cloud's Vector Engine. This snippet points to a specific branch for a basic boilerplate implementation. ```shell git clone https://github.com/SAP-samples/btp-cap-genai-rag.git cd btp-cap-genai-rag git checkout cap-genaihub-vectorengine-sample ``` -------------------------------- ### Clone btp-cap-genai-rag Repository Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/3-deploy/1-BuildTheComponents.md Clones the SAP Samples btp-cap-genai-rag repository from GitHub to your local development environment. ```sh git clone https://github.com/SAP-samples/btp-cap-genai-rag ``` -------------------------------- ### Build UI5 App (Optimized) Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/app/ui/README.md Performs an optimized build of the UI5 application, including UI5 resources. This creates a self-contained package for deployment to static web servers. ```Shell npm run build:opt ``` -------------------------------- ### Add Sample Mails to GenAI Mail Insights Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/4-test/1-PushSampleMails.md This request adds sample emails to the GenAI Mail Insights service. It supports both multi-tenant and single-tenant deployments by adjusting the endpoint. The request requires an authorization token and a JSON payload containing email details. ```sh ### ADD MAILS I @token = {{getXsuaaToken.response.body.$.access_token}} # @name addMailsI POST {{btpAppHostname}}/rest/api/mail-insights/addMails # Multi-tenant POST {{btpAppHostname}}/odata/v4/mail-insights # Single-tenant content-type: application/json Authorization: Bearer {{token}} { "mails":[ { "subject": "Disney World trip", "body": "Hello. I'm trying to book ...Lisa Brown", "sender": "lisa.brown@example.org" }, ... } ``` -------------------------------- ### Check Cloud Foundry Target and Login Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/3-deploy/2-DeployTheApplication.md Commands to check the current Cloud Foundry target organization and space, and to log in to the SAP BTP Cloud Foundry environment. Requires Cloud Foundry CLI and the API endpoint for your region. ```sh # Check target Org and Space # cf target # (Re-)Login if required # cf login -a "https://api.cf..hana.ondemand.com" ``` -------------------------------- ### Configure HTTP Request Variables Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/4-test/1-PushSampleMails.md Defines variables for authentication and application hostnames within an HTTP request file. These variables are used to dynamically configure requests for services like XSUAA and CAP applications. ```http @xsuaaHostname = @btpXsuaaClient = @btpXsuaaSecret = @btpAppHostname = ``` -------------------------------- ### Login to Cloud Foundry CLI Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/3-deploy/3-UndeployApplication.md Logs into the Cloud Foundry API endpoint for a specific region. Ensure you replace '<>' with your actual Cloud Foundry region. ```bash cf login -a https://api.cf.<>.hana.ondemand.com ``` -------------------------------- ### Build mtar File Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/3-deploy/1-BuildTheComponents.md Executes the build script to generate the Multi-Target Application Archive (mtar) file. This command should be run from the project's root folder. ```sh # Run in project's root folder # npm run build:mbt ``` -------------------------------- ### Run Undeploy Command Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/docs/tutorial/3-deploy/3-UndeployApplication.md Executes the undeployment script for the application. This command should be run from the project's root folder. ```sh # Run in project's root folder # npm run undeploy ``` -------------------------------- ### CAP-based GenAI RAG Application for Customer Support Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/README.md This sample application, built on SAP BTP's CAP, enhances customer support by analyzing emails using LLMs. It provides insights like categorization, sentiment analysis, and urgency assessment. Features include extracting key information, identifying similar historical emails via embeddings, summarizing and translating content, and generating potential responses. It can integrate with SAP systems like SAP Concur and is adaptable for multitenant SaaS solutions. ```shell git clone https://github.com/SAP-samples/btp-cap-genai-rag.git cd btp-cap-genai-rag mbt deploy ``` -------------------------------- ### Lint TypeScript Code Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/app/ui/README.md Lints the TypeScript code to enforce coding standards and identify potential issues. ```Shell npm run lint ``` -------------------------------- ### Type Check TypeScript Code Source: https://github.com/sap-samples/btp-cap-genai-rag/blob/main/app/ui/README.md Executes a TypeScript type check on the application code to identify type errors and syntax issues. ```Shell npm run ts-typecheck ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.