(request: ProviderRequest)
| 29 | export const MAX_TOOL_ITERATIONS = 20 |
| 30 | |
| 31 | function 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 | |
| 54 | function isStreamingExecution(response: any): response is StreamingExecution { |
| 55 | return response && typeof response === 'object' && 'stream' in response && 'execution' in response |
no test coverage detected