@@ -71,7 +71,11 @@ export class SchedulerAgent extends Agent<{ AI: any }, SchedulerAgentState> {
7171 /**
7272 * Processes user queries and determines the appropriate scheduling action.
7373 */
74- async query ( query : string ) : Promise < { confirmation ?: Confirmation ; message ?: string } | Schedule [ ] | string | undefined > {
74+ async query (
75+ query : string ,
76+ ) : Promise <
77+ { confirmation ?: Confirmation ; message ?: string } | Schedule [ ] | string | undefined
78+ > {
7579 const workersai = createWorkersAI ( { binding : this . env . AI } ) ;
7680 const aiModel = workersai ( "@cf/meta/llama-3.3-70b-instruct-fp8-fast" ) ;
7781
@@ -87,7 +91,10 @@ export class SchedulerAgent extends Agent<{ AI: any }, SchedulerAgentState> {
8791 }
8892
8993 if ( action === "add" ) {
90- const [ payload , scheduleType ] = await Promise . all ( [ extractAlarmMessage ( aiModel , query ) , extractAlarmType ( aiModel , query ) ] ) ;
94+ const [ payload , scheduleType ] = await Promise . all ( [
95+ extractAlarmMessage ( aiModel , query ) ,
96+ extractAlarmType ( aiModel , query ) ,
97+ ] ) ;
9198
9299 // We can use the same logic for delayed and schedule as they both refer to a
93100 // specific time in the future.
@@ -163,7 +170,10 @@ export class SchedulerAgent extends Agent<{ AI: any }, SchedulerAgentState> {
163170 /**
164171 * Confirms or rejects a pending scheduling operation based on user input.
165172 */
166- async confirm ( confirmationId : string , userConfirmed : boolean ) : Promise < Schedule | string | false | undefined > {
173+ async confirm (
174+ confirmationId : string ,
175+ userConfirmed : boolean ,
176+ ) : Promise < Schedule | string | false | undefined > {
167177 const confirmation = this . state . confirmations . find ( ( c ) => c . id === confirmationId ) ;
168178
169179 if ( ! confirmation ) {
@@ -204,7 +214,9 @@ export class SchedulerAgent extends Agent<{ AI: any }, SchedulerAgentState> {
204214 result = "User chose not to proceed with this action." ;
205215 }
206216
207- const remainingConfirmations = this . state . confirmations . filter ( ( c ) => c . id !== confirmationId ) ;
217+ const remainingConfirmations = this . state . confirmations . filter (
218+ ( c ) => c . id !== confirmationId ,
219+ ) ;
208220
209221 this . setState ( {
210222 ...this . state ,
0 commit comments