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

Function checkForForcedToolUsage

apps/sim/providers/azure-openai/utils.ts:23–38  ·  view source on GitHub ↗
(
  response: OpenAI.Chat.Completions.ChatCompletion,
  toolChoice: string | { type: string; function?: { name: string }; name?: string },
  _logger: Logger,
  forcedTools: string[],
  usedForcedTools: string[]
)

Source from the content-addressed store, hash-verified

21 * Uses the shared OpenAI-compatible forced tool usage helper.
22 */
23export function checkForForcedToolUsage(
24 response: OpenAI.Chat.Completions.ChatCompletion,
25 toolChoice: string | { type: string; function?: { name: string }; name?: string },
26 _logger: Logger,
27 forcedTools: string[],
28 usedForcedTools: string[]
29): { hasUsedForcedTool: boolean; usedForcedTools: string[] } {
30 return checkForForcedToolUsageOpenAI(
31 response,
32 toolChoice,
33 'Azure OpenAI',
34 forcedTools,
35 usedForcedTools,
36 _logger
37 )
38}
39
40/**
41 * Determines if an Azure OpenAI endpoint URL is for the chat completions API.

Callers 1

Calls 1

Tested by

no test coverage detected