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

Function checkForForcedToolUsage

apps/sim/providers/mistral/index.ts:192–209  ·  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

190 let usedForcedTools: string[] = []
191
192 const checkForForcedToolUsage = (
193 response: any,
194 toolChoice: string | { type: string; function?: { name: string }; name?: string; any?: any }
195 ) => {
196 if (typeof toolChoice === 'object' && response.choices[0]?.message?.tool_calls) {
197 const toolCallsResponse = response.choices[0].message.tool_calls
198 const result = trackForcedToolUsage(
199 toolCallsResponse,
200 toolChoice,
201 logger,
202 'mistral',
203 forcedTools,
204 usedForcedTools
205 )
206 hasUsedForcedTool = result.hasUsedForcedTool
207 usedForcedTools = result.usedForcedTools
208 }
209 }
210
211 let currentResponse = await mistral.chat.completions.create(
212 payload,

Callers 1

index.tsFile · 0.70

Calls 1

trackForcedToolUsageFunction · 0.90

Tested by

no test coverage detected