File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
templates/typescript/gemini-cua Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ const TEMPLATES: Record<TemplateKey, TemplateInfo> = {
9090 } ,
9191 [ TEMPLATE_GEMINI_CUA ] : {
9292 name : "Gemini Computer Use" ,
93- description : "Implements Gemini 2.5 Computer Use Agent with Stagehand " ,
93+ description : "Implements Gemini 2.5 Computer Use Agent" ,
9494 languages : [ LANGUAGE_TYPESCRIPT ] ,
9595 } ,
9696} ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const app = kernel.app('ts-gemini-cua');
1010interface SearchQueryOutput {
1111 success : boolean ;
1212 result : string ;
13+ error ?: string ;
1314}
1415
1516// API Keys for LLM providers
@@ -84,16 +85,15 @@ async function runStagehandTask(invocationId?: string): Promise<SearchQueryOutpu
8485
8586 console . log ( "result: " , result ) ;
8687
87- console . log ( "Deleting browser and closing stagehand..." ) ;
88- await stagehand . close ( ) ;
89- await kernel . browsers . deleteByID ( kernelBrowser . session_id ) ;
9088 return { success : true , result : result . message } ;
9189 } catch ( error ) {
9290 console . error ( error ) ;
91+ const errorMessage = error instanceof Error ? error . message : String ( error ) ;
92+ return { success : false , result : "" , error : errorMessage } ;
93+ } finally {
9394 console . log ( "Deleting browser and closing stagehand..." ) ;
9495 await stagehand . close ( ) ;
9596 await kernel . browsers . deleteByID ( kernelBrowser . session_id ) ;
96- return { success : false , result : "" } ;
9797 }
9898}
9999
You can’t perform that action at this time.
0 commit comments