-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(quantic): added relevant generative answering (rga) example in t…
…he quantic examples org (#3452) * initial commit and example setup * added example for RGA * added feedback, moved the gen answer component, removed template logic
- Loading branch information
1 parent
5e753f0
commit b16990e
Showing
7 changed files
with
375 additions
and
1 deletion.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...amples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
206 changes: 206 additions & 0 deletions
206
...mples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,206 @@ | ||
<template> | ||
<div | ||
class="search__container slds-p-around_medium" | ||
> | ||
<c-quantic-search-interface | ||
engine-id={engineId} | ||
search-hub={searchHub} | ||
pipeline={pipeline} | ||
disable-state-in-url={disableStateInUrl} | ||
skip-first-search={skipFirstSearch} | ||
> | ||
<c-quantic-aria-live></c-quantic-aria-live> | ||
<div class="slds-grid slds-grid_vertical slds-grid_align-center"> | ||
<div | ||
class="slds-col slds-size_1-of-1 slds-large-size_6-of-12 slds-align-middle" | ||
> | ||
<div class="slds-m-vertical_small"> | ||
<c-quantic-search-box | ||
engine-id={engineId} | ||
textarea | ||
></c-quantic-search-box> | ||
</div> | ||
</div> | ||
<div class="slds-col"> | ||
<div | ||
class="slds-grid slds-gutters_direct slds-wrap main slds-grid_align-center" | ||
> | ||
<div | ||
class="slds-col slds-order_2 slds-large-order_1 slds-size_1-of-1 slds-large-size_3-of-12 facets_container slds-show_large" | ||
> | ||
<c-quantic-facet-manager engine-id={engineId}> | ||
<c-quantic-facet | ||
field="objecttype" | ||
label="Type" | ||
engine-id={engineId} | ||
data-cy="type" | ||
></c-quantic-facet> | ||
<c-quantic-facet | ||
display-values-as="link" | ||
field="filetype" | ||
label="File Type" | ||
engine-id={engineId} | ||
> | ||
<c-quantic-facet-caption | ||
slot="captions" | ||
value="html" | ||
caption="HTML" | ||
></c-quantic-facet-caption> | ||
<c-quantic-facet-caption | ||
slot="captions" | ||
value="txt" | ||
caption="Text file" | ||
></c-quantic-facet-caption> | ||
<c-quantic-facet-caption | ||
slot="captions" | ||
value="pdf" | ||
caption="PDF" | ||
></c-quantic-facet-caption> | ||
<c-quantic-facet-caption | ||
slot="captions" | ||
value="YouTubeVideo" | ||
caption="YouTube Video" | ||
></c-quantic-facet-caption> | ||
</c-quantic-facet> | ||
<c-quantic-numeric-facet | ||
field="ytlikecount" | ||
label="Youtube Likes" | ||
with-input="integer" | ||
engine-id={engineId} | ||
></c-quantic-numeric-facet> | ||
<c-quantic-timeframe-facet | ||
engine-id={engineId} | ||
field="date" | ||
label="Date" | ||
with-date-picker | ||
> | ||
<c-quantic-timeframe unit="week"></c-quantic-timeframe> | ||
<c-quantic-timeframe unit="month"></c-quantic-timeframe> | ||
<c-quantic-timeframe | ||
amount="6" | ||
unit="month" | ||
></c-quantic-timeframe> | ||
<c-quantic-timeframe unit="year"></c-quantic-timeframe> | ||
</c-quantic-timeframe-facet> | ||
<c-quantic-category-facet | ||
with-search | ||
field="geographicalhierarchy" | ||
label="Country" | ||
engine-id={engineId} | ||
></c-quantic-category-facet> | ||
</c-quantic-facet-manager> | ||
</div> | ||
<div | ||
class="slds-col slds-order_1 slds-large-order_2 slds-size_1-of-1 slds-large-size_6-of-12" | ||
> | ||
<c-quantic-tab-bar> | ||
<c-quantic-tab | ||
label="All" | ||
engine-id={engineId} | ||
is-active | ||
></c-quantic-tab> | ||
<c-quantic-tab | ||
label="Articles" | ||
expression="@sfkbid" | ||
engine-id={engineId} | ||
></c-quantic-tab> | ||
<c-quantic-tab | ||
label="Issues" | ||
expression='@jisourcetype AND NOT @jidocumenttype="WorkLog"' | ||
engine-id={engineId} | ||
></c-quantic-tab> | ||
<c-quantic-tab | ||
label="Community" | ||
expression='@objecttype=="Message"' | ||
engine-id={engineId} | ||
></c-quantic-tab> | ||
<c-quantic-tab | ||
label="Files" | ||
expression="@boxdocumenttype==File OR @spcontenttype==Document" | ||
engine-id={engineId} | ||
></c-quantic-tab> | ||
<c-quantic-tab | ||
label="Thread" | ||
expression="@source==iNaturalistTaxons" | ||
engine-id={engineId} | ||
></c-quantic-tab> | ||
</c-quantic-tab-bar> | ||
<div class="slds-var-m-vertical_small"> | ||
<c-quantic-generated-answer | ||
engine-id={engineId} | ||
answer-style={answerStyle} | ||
multiline-footer={multilineFooter} | ||
></c-quantic-generated-answer> | ||
</div> | ||
<div class="slds-grid slds-var-m-top_small"> | ||
<c-quantic-summary | ||
class="slds-var-m-vertical_x-small slds-small-size_8-of-12 slds-large-size_7-of-12" | ||
engine-id={engineId} | ||
> | ||
</c-quantic-summary> | ||
<c-quantic-sort | ||
class="slds-var-m-vertical_xxx-small slds-large-size_5-of-12 slds-show_large" | ||
engine-id={engineId} | ||
> | ||
</c-quantic-sort> | ||
<div | ||
class="slds-small-size_4-of-12 slds-clearfix slds-hide_large" | ||
> | ||
<div class="slds-float_right"> | ||
<c-quantic-refine-toggle | ||
engine-id={engineId} | ||
full-screen | ||
></c-quantic-refine-toggle> | ||
</div> | ||
</div> | ||
</div> | ||
<c-quantic-query-error | ||
engine-id={engineId} | ||
></c-quantic-query-error> | ||
<c-quantic-breadcrumb-manager | ||
engine-id={engineId} | ||
></c-quantic-breadcrumb-manager> | ||
<c-quantic-did-you-mean | ||
engine-id={engineId} | ||
></c-quantic-did-you-mean> | ||
<c-quantic-no-results engine-id={engineId}></c-quantic-no-results> | ||
<div class="slds-var-m-vertical_small"> | ||
<c-quantic-smart-snippet | ||
engine-id={engineId} | ||
></c-quantic-smart-snippet> | ||
</div> | ||
<div class="slds-var-m-vertical_small"> | ||
<c-quantic-smart-snippet-suggestions | ||
engine-id={engineId} | ||
></c-quantic-smart-snippet-suggestions> | ||
</div> | ||
<c-quantic-folded-result-list | ||
engine-id={engineId} | ||
></c-quantic-folded-result-list> | ||
<div class="slds-var-m-vertical_medium"> | ||
<c-quantic-pager engine-id={engineId}></c-quantic-pager> | ||
<c-quantic-results-per-page | ||
engine-id={engineId} | ||
></c-quantic-results-per-page> | ||
</div> | ||
</div> | ||
<div | ||
class="slds-col slds-order_3 slds-large-order_3 slds-size_1-of-1 slds-large-size_3-of-12" | ||
> | ||
<div class="slds-m-bottom_large"> | ||
<c-quantic-recent-queries-list | ||
engine-id={engineId} | ||
></c-quantic-recent-queries-list> | ||
</div> | ||
<div class="slds-m-bottom_large"> | ||
<c-quantic-recent-results-list | ||
engine-id={engineId} | ||
></c-quantic-recent-results-list> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</c-quantic-search-interface> | ||
</div> | ||
</template> |
20 changes: 20 additions & 0 deletions
20
...xamples/main/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
32 changes: 32 additions & 0 deletions
32
...ain/lwc/exampleRelevantGenerativeAnswering/exampleRelevantGenerativeAnswering.js-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>56.0</apiVersion> | ||
<isExposed>true</isExposed> | ||
<targets> | ||
<target>lightning__RecordPage</target> | ||
<target>lightning__AppPage</target> | ||
<target>lightning__HomePage</target> | ||
<target>lightningCommunity__Page</target> | ||
<target>lightningCommunity__Default</target> | ||
</targets> | ||
<targetConfigs> | ||
<targetConfig targets="lightningCommunity__Default"> | ||
<property name="engineId" type="String" default="example-relevant-generative-answering" label="Enter Coveo Headless engine ID"/> | ||
<property name="searchHub" type="String" default="default" label="The search interface search hub"/> | ||
<property name="pipeline" type="String" default="genqatest" label="The search interface query pipeline"/> | ||
<property name="disableStateInUrl" type="Boolean" default="false" label="Disable state in URL"/> | ||
<property name="skipFirstSearch" type="Boolean" default="false" label="Skip first search"/> | ||
<property name="answerStyle" type="String" default="default" label="The format style of the generated answer"/> | ||
<property name="multilineFooter" type="Boolean" default="false" label="Display footer sections on multiple lines"/> | ||
</targetConfig> | ||
<targetConfig targets="lightning__AppPage, lightning__RecordPage, lightning__HomePage"> | ||
<property name="engineId" type="String" default="example-relevant-generative-answering" label="Enter Coveo Headless engine ID"/> | ||
<property name="searchHub" type="String" default="default" label="The search interface search hub"/> | ||
<property name="pipeline" type="String" default="genqatest" label="The search interface query pipeline"/> | ||
<property name="disableStateInUrl" type="Boolean" default="false" label="Disable state in URL"/> | ||
<property name="skipFirstSearch" type="Boolean" default="false" label="Skip first search"/> | ||
<property name="answerStyle" type="String" default="default" label="The format style of the generated answer"/> | ||
<property name="multilineFooter" type="Boolean" default="false" label="Display footer sections on multiple lines"/> | ||
</targetConfig> | ||
</targetConfigs> | ||
</LightningComponentBundle> |
11 changes: 11 additions & 0 deletions
11
...es-community/experiences/Quantic_Examples1/routes/relevantGenerativeAnsweringExample.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
Oops, something went wrong.