From ac1d4285d5b4f50e0cc5d9f4196ce41cba25b5f2 Mon Sep 17 00:00:00 2001 From: JasonHaley Date: Tue, 20 Feb 2024 20:48:56 -0500 Subject: [PATCH 1/2] Pass the selected approach to the chat component and to the api call --- packages/chat-component/src/components/chat-component.ts | 4 ++++ packages/webapp/src/pages/oneshot/OneShot.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/chat-component/src/components/chat-component.ts b/packages/chat-component/src/components/chat-component.ts index 515cb87f..83f0b495 100644 --- a/packages/chat-component/src/components/chat-component.ts +++ b/packages/chat-component/src/components/chat-component.ts @@ -72,6 +72,9 @@ export class ChatComponent extends LitElement { @property({ type: String, attribute: 'data-use-stream', converter: (value) => value?.toLowerCase() === 'true' }) useStream: boolean = chatHttpOptions.stream; + @property({ type: String, attribute: 'data-approach' }) + approach = requestOptions.approach; + @property({ type: String, attribute: 'data-overrides', converter: (value) => JSON.parse(value || '{}') }) overrides: RequestOverrides = {}; @@ -199,6 +202,7 @@ export class ChatComponent extends LitElement { await this.chatController.generateAnswer( { ...requestOptions, + approach: this.approach, overrides: { ...requestOptions.overrides, ...this.overrides, diff --git a/packages/webapp/src/pages/oneshot/OneShot.tsx b/packages/webapp/src/pages/oneshot/OneShot.tsx index b15de44d..a781368e 100644 --- a/packages/webapp/src/pages/oneshot/OneShot.tsx +++ b/packages/webapp/src/pages/oneshot/OneShot.tsx @@ -113,7 +113,7 @@ export function Component(): JSX.Element { data-interaction-model="ask" data-api-url={apiBaseUrl} data-use-stream="false" - data-approach="rrr" + data-approach={approach} data-overrides={JSON.stringify(overrides)} > From 6ed024c7a95965949f47a2bd60338bc342f8d9f8 Mon Sep 17 00:00:00 2001 From: JasonHaley Date: Mon, 26 Feb 2024 19:41:49 -0500 Subject: [PATCH 2/2] Changed default approach to match old rrr --- packages/webapp/src/pages/oneshot/OneShot.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webapp/src/pages/oneshot/OneShot.tsx b/packages/webapp/src/pages/oneshot/OneShot.tsx index a781368e..68136ba0 100644 --- a/packages/webapp/src/pages/oneshot/OneShot.tsx +++ b/packages/webapp/src/pages/oneshot/OneShot.tsx @@ -22,7 +22,7 @@ import { toolTipText, toolTipTextCalloutProps } from '../../i18n/tooltips.js'; export function Component(): JSX.Element { const [isConfigPanelOpen, setIsConfigPanelOpen] = useState(false); - const [approach, setApproach] = useState(Approaches.RetrieveThenRead); + const [approach, setApproach] = useState(Approaches.ReadRetrieveRead); const [promptTemplate, setPromptTemplate] = useState(''); const [promptTemplatePrefix, setPromptTemplatePrefix] = useState(''); const [promptTemplateSuffix, setPromptTemplateSuffix] = useState('');