Skip to content

Commit 8971b1e

Browse files
JasonHaleyJasonHaley
andauthored
fix: pass the selected approach to the chat component and to the api call (#188)
* Pass the selected approach to the chat component and to the api call * Changed default approach to match old rrr --------- Co-authored-by: JasonHaley <[email protected]>
1 parent 0fec15c commit 8971b1e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/chat-component/src/components/chat-component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ export class ChatComponent extends LitElement {
7070
@property({ type: String, attribute: 'data-use-stream', converter: (value) => value?.toLowerCase() === 'true' })
7171
useStream: boolean = chatHttpOptions.stream;
7272

73+
@property({ type: String, attribute: 'data-approach' })
74+
approach = requestOptions.approach;
75+
7376
@property({ type: String, attribute: 'data-overrides', converter: (value) => JSON.parse(value || '{}') })
7477
overrides: RequestOverrides = {};
7578

@@ -232,6 +235,7 @@ export class ChatComponent extends LitElement {
232235
await this.chatController.generateAnswer(
233236
{
234237
...requestOptions,
238+
approach: this.approach,
235239
overrides: {
236240
...requestOptions.overrides,
237241
...this.overrides,

packages/webapp/src/pages/oneshot/OneShot.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { toolTipText, toolTipTextCalloutProps } from '../../i18n/tooltips.js';
2222

2323
export function Component(): JSX.Element {
2424
const [isConfigPanelOpen, setIsConfigPanelOpen] = useState(false);
25-
const [approach, setApproach] = useState<Approaches>(Approaches.RetrieveThenRead);
25+
const [approach, setApproach] = useState<Approaches>(Approaches.ReadRetrieveRead);
2626
const [promptTemplate, setPromptTemplate] = useState<string>('');
2727
const [promptTemplatePrefix, setPromptTemplatePrefix] = useState<string>('');
2828
const [promptTemplateSuffix, setPromptTemplateSuffix] = useState<string>('');
@@ -113,7 +113,7 @@ export function Component(): JSX.Element {
113113
data-interaction-model="ask"
114114
data-api-url={apiBaseUrl}
115115
data-use-stream="false"
116-
data-approach="rrr"
116+
data-approach={approach}
117117
data-overrides={JSON.stringify(overrides)}
118118
></chat-component>
119119
</div>

0 commit comments

Comments
 (0)