Skip to content

Commit ea1b395

Browse files
authored
Fix StructuredOutputType selector in agent editor (#629)
1 parent 4326c80 commit ea1b395

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

frontend/src/components/experiment_builder/agent_chat_prompt_editor.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ export class EditorComponent extends MobxLitElement {
526526
const appendToPrompt = !config.appendToPrompt;
527527
updateConfig({appendToPrompt});
528528
};
529-
const updateType = (e: InputEvent) => {
529+
const updateType = (e: Event) => {
530530
const type = (e.target as HTMLSelectElement)
531531
.value as StructuredOutputType;
532532
updateConfig({type});
@@ -545,17 +545,25 @@ export class EditorComponent extends MobxLitElement {
545545
</div>
546546
<select
547547
id="structuredOutputType"
548-
.selected=${config.type}
549548
@change=${updateType}
550549
?disabled=${!this.experimentEditor.canEditStages}
551550
>
552-
<option value="${StructuredOutputType.NONE}">
551+
<option
552+
value="${StructuredOutputType.NONE}"
553+
?selected=${config.type === StructuredOutputType.NONE}
554+
>
553555
No output forcing
554556
</option>
555-
<option value="${StructuredOutputType.JSON_FORMAT}">
557+
<option
558+
value="${StructuredOutputType.JSON_FORMAT}"
559+
?selected=${config.type === StructuredOutputType.JSON_FORMAT}
560+
>
556561
Force JSON output
557562
</option>
558-
<option value="${StructuredOutputType.JSON_SCHEMA}">
563+
<option
564+
value="${StructuredOutputType.JSON_SCHEMA}"
565+
?selected=${config.type === StructuredOutputType.JSON_SCHEMA}
566+
>
559567
Force JSON output with schema
560568
</option>
561569
</select>

0 commit comments

Comments
 (0)