(
response: any,
toolChoice: string | { type: string; function?: { name: string }; name?: string; any?: any }
)
| 259 | let usedForcedTools: string[] = [] |
| 260 | |
| 261 | const checkForForcedToolUsage = ( |
| 262 | response: any, |
| 263 | toolChoice: string | { type: string; function?: { name: string }; name?: string; any?: any } |
| 264 | ) => { |
| 265 | if (typeof toolChoice === 'object' && response.choices[0]?.message?.tool_calls) { |
| 266 | const toolCallsResponse = response.choices[0].message.tool_calls |
| 267 | const result = trackForcedToolUsage( |
| 268 | toolCallsResponse, |
| 269 | toolChoice, |
| 270 | logger, |
| 271 | 'litellm', |
| 272 | forcedTools, |
| 273 | usedForcedTools |
| 274 | ) |
| 275 | hasUsedForcedTool = result.hasUsedForcedTool |
| 276 | usedForcedTools = result.usedForcedTools |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | let currentResponse = await litellm.chat.completions.create( |
| 281 | payload, |
no test coverage detected