From b16990e55ac07b1b1846bd133b76d5338874cb24 Mon Sep 17 00:00:00 2001 From: Simon Milord Date: Wed, 6 Dec 2023 16:42:41 -0500 Subject: [PATCH] feat(quantic): added relevant generative answering (rga) example in the quantic examples org (#3452) * initial commit and example setup * added example for RGA * added feedback, moved the gen answer component, removed template logic --- .../exampleRelevantGenerativeAnswering.css | 22 ++ .../exampleRelevantGenerativeAnswering.html | 206 ++++++++++++++++++ .../exampleRelevantGenerativeAnswering.js | 20 ++ ...pleRelevantGenerativeAnswering.js-meta.xml | 32 +++ .../relevantGenerativeAnsweringExample.json | 11 + .../Quantic_Examples1/views/home.json | 2 +- .../relevantGenerativeAnsweringExample.json | 83 +++++++ 7 files changed, 375 insertions(+), 1 deletion(-) create mode 100644 packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.css create mode 100644 packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.html create mode 100644 packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.js create mode 100644 packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.js-meta.xml create mode 100644 packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/routes/relevantGenerativeAnsweringExample.json create mode 100644 packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/views/relevantGenerativeAnsweringExample.json diff --git a/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.css b/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.css new file mode 100644 index 00000000000..296fc51d42f --- /dev/null +++ b/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.css @@ -0,0 +1,22 @@ +/* + * Styling hooks are not supported by the LWC Local Development Server. + * You can safely comment those out in order to run the code in the Local Dev Server, these are for a11y purpose only. + * Issue opened to Salesforce: https://github.com/forcedotcom/salesforcedx-vscode/issues/4493 + * + * These values change the border colors of the checkboxes, text inputs and buttons borders to a higher contrast value + * to better respect accessibility standards. + */ +:host { + --slds-c-checkbox-color-border: var(--lwc-colorTextIconDefault, #747474); + --slds-c-checkbox-color-border-checked: var(--lwc-colorTextIconDefault, #747474); + --slds-c-input-color-border: var(--lwc-colorTextIconDefault, #747474); + --slds-c-button-neutral-color-border: var(--lwc-colorTextIconDefault, #747474); +} + + +.search__container { + position: relative; + background: #fff; + border-radius: .25rem; + background-clip: padding-box; +} diff --git a/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.html b/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.html new file mode 100644 index 00000000000..4d6d788a5ca --- /dev/null +++ b/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.html @@ -0,0 +1,206 @@ + diff --git a/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.js b/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.js new file mode 100644 index 00000000000..8806f0dd7aa --- /dev/null +++ b/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.js @@ -0,0 +1,20 @@ +import {LightningElement, api} from 'lwc'; + +// For the 'genqatest' query pipeline, the following query should yield a relevant generated answer: How to resolve netflix connection with tivo? + +export default class ExampleRelevantGenerativeAnswering extends LightningElement { + /** @type {string} */ + @api engineId = 'example-relevant-generative-answering'; + /** @type {string} */ + @api searchHub = 'default'; + /** @type {string} */ + @api pipeline = 'genqatest'; + /** @type {boolean} */ + @api disableStateInUrl = false; + /** @type {boolean} */ + @api skipFirstSearch = false; + /** @type {string} */ + @api answerStyle = 'default'; + /** @type {boolean} */ + @api multilineFooter = false; +} diff --git a/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.js-meta.xml b/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.js-meta.xml new file mode 100644 index 00000000000..62794821859 --- /dev/null +++ b/packages/quantic/force-app/examples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.js-meta.xml @@ -0,0 +1,32 @@ + + + 56.0 + true + + lightning__RecordPage + lightning__AppPage + lightning__HomePage + lightningCommunity__Page + lightningCommunity__Default + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/routes/relevantGenerativeAnsweringExample.json b/packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/routes/relevantGenerativeAnsweringExample.json new file mode 100644 index 00000000000..9b61fa6f0c0 --- /dev/null +++ b/packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/routes/relevantGenerativeAnsweringExample.json @@ -0,0 +1,11 @@ +{ + "activeViewId": "27d477db-01c7-4f6b-b918-ab4734a27cd5", + "appPageId": "2199ef25-89a9-44a1-ad69-7cb8bd918245", + "configurationTags": [], + "id": "844569ed-fc9d-4a4d-89c1-321ec2b4e977", + "label": "Relevant Generative Answering Example", + "pageAccess": "UseParent", + "routeType": "custom-relevant-generative-answering-example", + "type": "route", + "urlPrefix": "relevant-generative-answering-example" +} diff --git a/packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/views/home.json b/packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/views/home.json index 7f70d3f347f..7f4a0d45516 100644 --- a/packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/views/home.json +++ b/packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/views/home.json @@ -14,7 +14,7 @@ "components": [ { "componentAttributes": { - "richTextValue": "

Quantic Examples


Typical Use Cases



Quantic Components


" + "richTextValue": "

Quantic Examples


Typical Use Cases



Quantic Components


" }, "componentName": "forceCommunity:richTextInline", "id": "1c5c28a3-9570-4c6c-abf9-52ad1b26582a", diff --git a/packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/views/relevantGenerativeAnsweringExample.json b/packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/views/relevantGenerativeAnsweringExample.json new file mode 100644 index 00000000000..c91da8d6fbb --- /dev/null +++ b/packages/quantic/quantic-examples-community/experiences/Quantic_Examples1/views/relevantGenerativeAnsweringExample.json @@ -0,0 +1,83 @@ +{ + "appPageId": "2199ef25-89a9-44a1-ad69-7cb8bd918245", + "componentName": "siteforce:dynamicLayout", + "dataProviders": [], + "id": "27d477db-01c7-4f6b-b918-ab4734a27cd5", + "label": "Relevant Generative Answering Example", + "regions": [ + { + "components": [ + { + "componentAttributes": { + "background": "background: rgba(0,0,0,0)", + "backgroundOverlay": "rgba(0,0,0,0.5)", + "contentAreaWidth": 100, + "sectionConfig": { + "UUID": "4e535adc-a136-4f54-b8a6-e9e2f381972f", + "columns": [ + { + "UUID": "0b2fe4b1-91e6-4bae-abe4-1ef68b7686c2", + "columnKey": "1", + "columnName": "Column 1", + "columnWidth": "12", + "seedComponents": [] + } + ] + }, + "sectionHeight": 300 + }, + "componentName": "forceCommunity:section", + "id": "4e535adc-a136-4f54-b8a6-e9e2f381972f", + "regions": [ + { + "components": [ + { + "componentAttributes": { + "engineId": "example-relevant-generative-answering" + }, + "componentName": "c:exampleRelevantGenerativeAnswering", + "id": "8b766029-754a-4d58-9a8b-efb59c50e8e1", + "renderPriority": "NEUTRAL", + "renditionMap": {}, + "type": "component" + } + ], + "id": "0b2fe4b1-91e6-4bae-abe4-1ef68b7686c2", + "regionLabel": "Column 1", + "regionName": "1", + "renditionMap": {}, + "type": "region" + } + ], + "renderPriority": "NEUTRAL", + "renditionMap": {}, + "type": "component" + } + ], + "id": "4c1e87ae-f521-49ca-a7a7-7e9e2fab53b0", + "regionName": "content", + "type": "region" + }, + { + "components": [ + { + "componentAttributes": { + "customHeadTags": "", + "description": "", + "title": "Relevant Generative Answering Example" + }, + "componentName": "forceCommunity:seoAssistant", + "id": "5c710339-d717-4911-bd05-1e4357a3806a", + "renditionMap": {}, + "type": "component" + } + ], + "id": "7481b0e7-7f4b-463f-ac2b-7d772b6545d0", + "regionName": "sfdcHiddenRegion", + "type": "region" + } + ], + "themeLayoutType": "Inner", + "type": "view", + "viewType": "custom-relevant-generative-answering-example" +}