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

Function sanitizeRequest

apps/sim/providers/index.ts:31–52  ·  view source on GitHub ↗
(request: ProviderRequest)

Source from the content-addressed store, hash-verified

29export const MAX_TOOL_ITERATIONS = 20
30
31function sanitizeRequest(request: ProviderRequest): ProviderRequest {
32 const sanitizedRequest = { ...request }
33 const model = sanitizedRequest.model
34
35 if (model && !supportsTemperature(model)) {
36 sanitizedRequest.temperature = undefined
37 }
38
39 if (model && !supportsReasoningEffort(model)) {
40 sanitizedRequest.reasoningEffort = undefined
41 }
42
43 if (model && !supportsVerbosity(model)) {
44 sanitizedRequest.verbosity = undefined
45 }
46
47 if (model && !supportsThinking(model)) {
48 sanitizedRequest.thinkingLevel = undefined
49 }
50
51 return sanitizedRequest
52}
53
54function isStreamingExecution(response: any): response is StreamingExecution {
55 return response && typeof response === 'object' && 'stream' in response && 'execution' in response

Callers 1

executeProviderRequestFunction · 0.85

Calls 4

supportsTemperatureFunction · 0.90
supportsReasoningEffortFunction · 0.90
supportsVerbosityFunction · 0.90
supportsThinkingFunction · 0.90

Tested by

no test coverage detected