Skip to content

Commit

Permalink
Pass the selected approach to the chat component and to the api call
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonHaley committed Feb 21, 2024
1 parent 09d23cd commit ac1d428
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/chat-component/src/components/chat-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};

Expand Down Expand Up @@ -199,6 +202,7 @@ export class ChatComponent extends LitElement {
await this.chatController.generateAnswer(
{
...requestOptions,
approach: this.approach,
overrides: {
...requestOptions.overrides,
...this.overrides,
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/pages/oneshot/OneShot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
></chat-component>
</div>
Expand Down

0 comments on commit ac1d428

Please sign in to comment.