From ac1d4285d5b4f50e0cc5d9f4196ce41cba25b5f2 Mon Sep 17 00:00:00 2001 From: JasonHaley Date: Tue, 20 Feb 2024 20:48:56 -0500 Subject: [PATCH] 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)} >