@@ -112,7 +112,7 @@ async function executeTools(
112112 toolCalls : ToolUseContent [ ] ,
113113 tools : Tool [ ] ,
114114 messages : Message [ ] ,
115- logger : Logger
115+ logger : Logger ,
116116) : Promise < ToolCallResult > {
117117 if ( toolCalls . length === 0 ) {
118118 return { sequenceCompleted : false , toolResults : [ ] } ;
@@ -134,7 +134,7 @@ async function executeTools(
134134 content : toolResult ,
135135 isComplete : call . name === "sequenceComplete" ,
136136 } ;
137- } )
137+ } ) ,
138138 ) ;
139139
140140 const toolResults = results . map ( ( { type, tool_use_id, content } ) => ( {
@@ -160,7 +160,7 @@ export const toolAgent = async (
160160 initialPrompt : string ,
161161 tools : Tool [ ] ,
162162 logger : Logger ,
163- config = CONFIG
163+ config = CONFIG ,
164164) : Promise < ToolAgentResult > => {
165165 logger . verbose ( "Starting agent execution" ) ;
166166 logger . verbose ( "Initial prompt:" , initialPrompt ) ;
@@ -189,7 +189,7 @@ export const toolAgent = async (
189189 logger . verbose (
190190 `Requesting completion ${ i + 1 } with ${ messages . length } messages with ${
191191 JSON . stringify ( messages ) . length
192- } bytes`
192+ } bytes`,
193193 ) ;
194194
195195 interactions ++ ;
@@ -218,15 +218,15 @@ export const toolAgent = async (
218218 interactions,
219219 } ;
220220 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` ,
222222 ) ;
223223 return result ;
224224 }
225225
226226 totalInputTokens += response . usage . input_tokens ;
227227 totalOutputTokens += response . usage . output_tokens ;
228228 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` ,
230230 ) ;
231231
232232 const { content, toolCalls } = processResponse ( response ) ;
@@ -245,7 +245,7 @@ export const toolAgent = async (
245245 toolCalls ,
246246 tools ,
247247 messages ,
248- logger
248+ logger ,
249249 ) ;
250250
251251 if ( sequenceCompleted ) {
@@ -260,7 +260,7 @@ export const toolAgent = async (
260260 interactions,
261261 } ;
262262 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` ,
264264 ) ;
265265 return result ;
266266 }
@@ -276,7 +276,7 @@ export const toolAgent = async (
276276 interactions,
277277 } ;
278278 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` ,
280280 ) ;
281281 return result ;
282282} ;
0 commit comments