@@ -2,8 +2,10 @@ import { Chatbot } from '../types/chatbot'
22import { CHATBOTS } from '@shared/constants/chatbots'
33import { show_response_ready_notification } from '../utils/show-response-ready-notification'
44import { add_apply_response_button } from '../utils/add-apply-response-button'
5- import { Logger } from '@shared/utils/logger'
6- import { report_initialization_error } from '../utils/report-initialization-error'
5+ import {
6+ InitializationError ,
7+ report_initialization_error
8+ } from '../utils/report-initialization-error'
79
810export const ai_studio : Chatbot = {
911 wait_until_ready : async ( ) => {
@@ -36,7 +38,7 @@ export const ai_studio: Chatbot = {
3638 report_initialization_error ( {
3739 function_name : 'set_model' ,
3840 log_message : 'Model selector button not found' ,
39- alert_message : 'Unable to set model'
41+ alert_message : InitializationError . UNABLE_TO_SET_MODEL
4042 } )
4143 return
4244 }
@@ -47,7 +49,7 @@ export const ai_studio: Chatbot = {
4749 report_initialization_error ( {
4850 function_name : 'set_model' ,
4951 log_message : 'Model name element not found' ,
50- alert_message : 'Unable to set model'
52+ alert_message : InitializationError . UNABLE_TO_SET_MODEL
5153 } )
5254 return
5355 }
@@ -92,7 +94,7 @@ export const ai_studio: Chatbot = {
9294 report_initialization_error ( {
9395 function_name : 'enter_system_instructions' ,
9496 log_message : 'System instructions button not found' ,
95- alert_message : 'Unable to set system instructions'
97+ alert_message : InitializationError . UNABLE_TO_SET_SYSTEM_INSTRUCTIONS
9698 } )
9799 return
98100 }
@@ -107,7 +109,7 @@ export const ai_studio: Chatbot = {
107109 report_initialization_error ( {
108110 function_name : 'enter_system_instructions' ,
109111 log_message : 'Close button for system instructions dialog not found' ,
110- alert_message : 'Unable to set system instructions'
112+ alert_message : InitializationError . UNABLE_TO_SET_SYSTEM_INSTRUCTIONS
111113 } )
112114 return
113115 }
@@ -119,7 +121,7 @@ export const ai_studio: Chatbot = {
119121 report_initialization_error ( {
120122 function_name : 'enter_system_instructions' ,
121123 log_message : 'System instructions panel not found' ,
122- alert_message : 'Unable to set system instructions'
124+ alert_message : InitializationError . UNABLE_TO_SET_SYSTEM_INSTRUCTIONS
123125 } )
124126 return
125127 }
@@ -129,7 +131,7 @@ export const ai_studio: Chatbot = {
129131 report_initialization_error ( {
130132 function_name : 'enter_system_instructions' ,
131133 log_message : 'System instructions textarea not found' ,
132- alert_message : 'Unable to set system instructions'
134+ alert_message : InitializationError . UNABLE_TO_SET_SYSTEM_INSTRUCTIONS
133135 } )
134136 return
135137 }
@@ -163,7 +165,7 @@ export const ai_studio: Chatbot = {
163165 report_initialization_error ( {
164166 function_name : 'set_options' ,
165167 log_message : 'Thinking toggle not found' ,
166- alert_message : 'Unable to set options'
168+ alert_message : InitializationError . UNABLE_TO_SET_OPTIONS
167169 } )
168170 return
169171 }
@@ -196,7 +198,7 @@ export const ai_studio: Chatbot = {
196198 report_initialization_error ( {
197199 function_name : 'set_options' ,
198200 log_message : 'Temporary chat toggle not found' ,
199- alert_message : 'Unable to set options'
201+ alert_message : InitializationError . UNABLE_TO_SET_OPTIONS
200202 } )
201203 return
202204 }
@@ -211,7 +213,7 @@ export const ai_studio: Chatbot = {
211213 report_initialization_error ( {
212214 function_name : 'set_options' ,
213215 log_message : 'Grounding with Google Search button not found' ,
214- alert_message : 'Unable to set options'
216+ alert_message : InitializationError . UNABLE_TO_SET_OPTIONS
215217 } )
216218 return
217219 }
@@ -230,7 +232,7 @@ export const ai_studio: Chatbot = {
230232 report_initialization_error ( {
231233 function_name : 'set_options' ,
232234 log_message : 'URL context button not found' ,
233- alert_message : 'Unable to set options'
235+ alert_message : InitializationError . UNABLE_TO_SET_OPTIONS
234236 } )
235237 return
236238 }
@@ -247,7 +249,7 @@ export const ai_studio: Chatbot = {
247249 report_initialization_error ( {
248250 function_name : 'set_temperature' ,
249251 log_message : 'Temperature input not found' ,
250- alert_message : 'Unable to set temperature'
252+ alert_message : InitializationError . UNABLE_TO_SET_TEMPERATURE
251253 } )
252254 return
253255 }
@@ -264,7 +266,7 @@ export const ai_studio: Chatbot = {
264266 report_initialization_error ( {
265267 function_name : 'set_thinking_budget' ,
266268 log_message : 'Manual budget toggle not found' ,
267- alert_message : 'Unable to set thinking budget'
269+ alert_message : InitializationError . UNABLE_TO_SET_THINKING_BUDGET
268270 } )
269271 return
270272 }
@@ -280,7 +282,7 @@ export const ai_studio: Chatbot = {
280282 report_initialization_error ( {
281283 function_name : 'set_thinking_budget' ,
282284 log_message : 'Thinking toggle not found' ,
283- alert_message : 'Unable to set thinking budget'
285+ alert_message : InitializationError . UNABLE_TO_SET_THINKING_BUDGET
284286 } )
285287 return
286288 }
@@ -295,7 +297,7 @@ export const ai_studio: Chatbot = {
295297 report_initialization_error ( {
296298 function_name : 'set_thinking_budget' ,
297299 log_message : 'Manual budget toggle not found' ,
298- alert_message : 'Unable to set thinking budget'
300+ alert_message : InitializationError . UNABLE_TO_SET_THINKING_BUDGET
299301 } )
300302 return
301303 }
@@ -310,7 +312,7 @@ export const ai_studio: Chatbot = {
310312 report_initialization_error ( {
311313 function_name : 'set_thinking_budget' ,
312314 log_message : 'Budget input not found' ,
313- alert_message : 'Unable to set thinking budget'
315+ alert_message : InitializationError . UNABLE_TO_SET_THINKING_BUDGET
314316 } )
315317 return
316318 }
@@ -345,7 +347,7 @@ export const ai_studio: Chatbot = {
345347 report_initialization_error ( {
346348 function_name : 'set_top_p' ,
347349 log_message : 'Top-p input not found' ,
348- alert_message : 'Unable to set top-p'
350+ alert_message : InitializationError . UNABLE_TO_SET_TOP_P
349351 } )
350352 return
351353 }
@@ -360,7 +362,7 @@ export const ai_studio: Chatbot = {
360362 report_initialization_error ( {
361363 function_name : 'enter_message_and_send' ,
362364 log_message : 'Message input textarea not found' ,
363- alert_message : 'Unable to send message'
365+ alert_message : InitializationError . UNABLE_TO_SEND_MESSAGE
364366 } )
365367 return
366368 }
@@ -390,7 +392,7 @@ export const ai_studio: Chatbot = {
390392 report_initialization_error ( {
391393 function_name : 'enter_message_and_send' ,
392394 log_message : 'Send button not found' ,
393- alert_message : 'Unable to send message'
395+ alert_message : InitializationError . UNABLE_TO_SEND_MESSAGE
394396 } )
395397 return
396398 }
@@ -409,7 +411,7 @@ export const ai_studio: Chatbot = {
409411 report_initialization_error ( {
410412 function_name : 'ai_studio.perform_copy' ,
411413 log_message : 'Chat turn container not found' ,
412- alert_message : 'Unable to copy response'
414+ alert_message : InitializationError . UNABLE_TO_COPY_RESPONSE
413415 } )
414416 return
415417 }
@@ -420,7 +422,7 @@ export const ai_studio: Chatbot = {
420422 report_initialization_error ( {
421423 function_name : 'ai_studio.perform_copy' ,
422424 log_message : 'Options button not found' ,
423- alert_message : 'Unable to copy response'
425+ alert_message : InitializationError . UNABLE_TO_COPY_RESPONSE
424426 } )
425427 return
426428 }
@@ -434,7 +436,7 @@ export const ai_studio: Chatbot = {
434436 report_initialization_error ( {
435437 function_name : 'ai_studio.perform_copy' ,
436438 log_message : 'Markdown copy button not found' ,
437- alert_message : 'Unable to copy response'
439+ alert_message : InitializationError . UNABLE_TO_COPY_RESPONSE
438440 } )
439441 return
440442 }
@@ -480,7 +482,7 @@ const open_panel = async () => {
480482 report_initialization_error ( {
481483 function_name : 'open_panel' ,
482484 log_message : 'Tune button not found' ,
483- alert_message : 'Unable to open settings panel'
485+ alert_message : InitializationError . UNABLE_TO_OPEN_SETTINGS_PANEL
484486 } )
485487 return
486488 }
@@ -498,7 +500,7 @@ const close_panel = async () => {
498500 report_initialization_error ( {
499501 function_name : 'close_panel' ,
500502 log_message : 'Close button for settings panel not found' ,
501- alert_message : 'Unable to close settings panel'
503+ alert_message : InitializationError . UNABLE_TO_CLOSE_SETTINGS_PANEL
502504 } )
503505 return
504506 }
@@ -512,7 +514,7 @@ const close_panel = async () => {
512514 report_initialization_error ( {
513515 function_name : 'close_panel' ,
514516 log_message : 'Close button for settings panel not found' ,
515- alert_message : 'Unable to close settings panel'
517+ alert_message : InitializationError . UNABLE_TO_CLOSE_SETTINGS_PANEL
516518 } )
517519 return
518520 }
0 commit comments