@@ -29,7 +29,8 @@ export const ai_studio: Chatbot = {
2929 check_for_element ( )
3030 } )
3131 } ,
32- enter_system_instructions : async ( system_instructions ?: string ) => {
32+ enter_system_instructions : async ( chat ) => {
33+ const system_instructions = chat . system_instructions
3334 if ( ! system_instructions ) return
3435 await open_panel ( )
3536 const system_instructions_button = document . querySelector (
@@ -84,7 +85,8 @@ export const ai_studio: Chatbot = {
8485 close_button . click ( )
8586 await new Promise ( ( r ) => requestAnimationFrame ( r ) )
8687 } ,
87- set_options : async ( options ?: string [ ] ) => {
88+ set_options : async ( chat ) => {
89+ const options = chat . options
8890 if ( ! options ) return
8991 const settings_items = Array . from (
9092 document . querySelectorAll ( 'div.settings-item' )
@@ -178,7 +180,8 @@ export const ai_studio: Chatbot = {
178180 }
179181 await new Promise ( ( r ) => requestAnimationFrame ( r ) )
180182 } ,
181- set_temperature : async ( temperature ?: number ) => {
183+ set_temperature : async ( chat ) => {
184+ const temperature = chat . temperature
182185 if ( temperature === undefined ) return
183186 const temperature_element = document . querySelector (
184187 'ms-prompt-run-settings div[data-test-id="temperatureSliderContainer"] input[type=number]'
@@ -193,7 +196,8 @@ export const ai_studio: Chatbot = {
193196 temperature_element . value = temperature . toString ( )
194197 temperature_element . dispatchEvent ( new Event ( 'change' , { bubbles : true } ) )
195198 } ,
196- set_reasoning_effort : async ( reasoning_effort ?: string ) => {
199+ set_reasoning_effort : async ( chat ) => {
200+ const reasoning_effort = chat . reasoning_effort
197201 if ( ! reasoning_effort ) return
198202
199203 await open_panel ( )
@@ -239,7 +243,8 @@ export const ai_studio: Chatbot = {
239243
240244 await new Promise ( ( r ) => requestAnimationFrame ( r ) )
241245 } ,
242- set_thinking_budget : async ( thinking_budget ?: number ) => {
246+ set_thinking_budget : async ( chat ) => {
247+ const thinking_budget = chat . thinking_budget
243248 if ( thinking_budget === undefined ) {
244249 const thinking_toggle = document . querySelector (
245250 'mat-slide-toggle[data-test-toggle="enable-thinking"] button'
@@ -306,7 +311,8 @@ export const ai_studio: Chatbot = {
306311 budget_input . dispatchEvent ( new Event ( 'change' , { bubbles : true } ) )
307312 }
308313 } ,
309- set_top_p : async ( top_p ?: number ) => {
314+ set_top_p : async ( chat ) => {
315+ const top_p = chat . top_p
310316 if ( top_p === undefined ) return
311317 const settings_items = Array . from (
312318 document . querySelectorAll ( 'div.settings-item' )
0 commit comments