MCPcopy Index your code
hub / github.com/simstudioai/sim / checkForForcedToolUsage

Function checkForForcedToolUsage

apps/sim/providers/litellm/index.ts:261–278  ·  view source on GitHub ↗
(
        response: any,
        toolChoice: string | { type: string; function?: { name: string }; name?: string; any?: any }
      )

Source from the content-addressed store, hash-verified

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,

Callers 1

index.tsFile · 0.70

Calls 1

trackForcedToolUsageFunction · 0.90

Tested by

no test coverage detected