@@ -112,7 +112,7 @@ async function executeTools(
112
112
toolCalls : ToolUseContent [ ] ,
113
113
tools : Tool [ ] ,
114
114
messages : Message [ ] ,
115
- logger : Logger
115
+ logger : Logger ,
116
116
) : Promise < ToolCallResult > {
117
117
if ( toolCalls . length === 0 ) {
118
118
return { sequenceCompleted : false , toolResults : [ ] } ;
@@ -134,7 +134,7 @@ async function executeTools(
134
134
content : toolResult ,
135
135
isComplete : call . name === "sequenceComplete" ,
136
136
} ;
137
- } )
137
+ } ) ,
138
138
) ;
139
139
140
140
const toolResults = results . map ( ( { type, tool_use_id, content } ) => ( {
@@ -160,7 +160,7 @@ export const toolAgent = async (
160
160
initialPrompt : string ,
161
161
tools : Tool [ ] ,
162
162
logger : Logger ,
163
- config = CONFIG
163
+ config = CONFIG ,
164
164
) : Promise < ToolAgentResult > => {
165
165
logger . verbose ( "Starting agent execution" ) ;
166
166
logger . verbose ( "Initial prompt:" , initialPrompt ) ;
@@ -189,7 +189,7 @@ export const toolAgent = async (
189
189
logger . verbose (
190
190
`Requesting completion ${ i + 1 } with ${ messages . length } messages with ${
191
191
JSON . stringify ( messages ) . length
192
- } bytes`
192
+ } bytes`,
193
193
) ;
194
194
195
195
interactions ++ ;
@@ -218,15 +218,15 @@ export const toolAgent = async (
218
218
interactions,
219
219
} ;
220
220
logger . verbose (
221
- `Agent completed with ${ result . tokens . input } input tokens, ${ result . tokens . output } output tokens in ${ result . interactions } interactions`
221
+ `Agent completed with ${ result . tokens . input } input tokens, ${ result . tokens . output } output tokens in ${ result . interactions } interactions` ,
222
222
) ;
223
223
return result ;
224
224
}
225
225
226
226
totalInputTokens += response . usage . input_tokens ;
227
227
totalOutputTokens += response . usage . output_tokens ;
228
228
logger . verbose (
229
- ` Token usage: ${ response . usage . input_tokens } input, ${ response . usage . output_tokens } output`
229
+ ` Token usage: ${ response . usage . input_tokens } input, ${ response . usage . output_tokens } output` ,
230
230
) ;
231
231
232
232
const { content, toolCalls } = processResponse ( response ) ;
@@ -245,7 +245,7 @@ export const toolAgent = async (
245
245
toolCalls ,
246
246
tools ,
247
247
messages ,
248
- logger
248
+ logger ,
249
249
) ;
250
250
251
251
if ( sequenceCompleted ) {
@@ -260,7 +260,7 @@ export const toolAgent = async (
260
260
interactions,
261
261
} ;
262
262
logger . verbose (
263
- `Agent completed with ${ result . tokens . input } input tokens, ${ result . tokens . output } output tokens in ${ result . interactions } interactions`
263
+ `Agent completed with ${ result . tokens . input } input tokens, ${ result . tokens . output } output tokens in ${ result . interactions } interactions` ,
264
264
) ;
265
265
return result ;
266
266
}
@@ -276,7 +276,7 @@ export const toolAgent = async (
276
276
interactions,
277
277
} ;
278
278
logger . verbose (
279
- `Agent completed with ${ result . tokens . input } input tokens, ${ result . tokens . output } output tokens in ${ result . interactions } interactions`
279
+ `Agent completed with ${ result . tokens . input } input tokens, ${ result . tokens . output } output tokens in ${ result . interactions } interactions` ,
280
280
) ;
281
281
return result ;
282
282
} ;
0 commit comments