MCPcopy Create free account
hub / github.com/Noumena-Network/code / loadNativeBinding

Function loadNativeBinding

src/services/api/openAICompatWsV2Native.ts:80–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78}
79
80function loadNativeBinding(): NativeWsV2Binding | null {
81 for (const moduleId of candidateNativeBindingModuleIds()) {
82 try {
83 const binding = require(moduleId) as NativeWsV2Binding
84 const validBinding = validateNativeBinding(binding)
85 if (validBinding) {
86 logForDebugging(`[OpenAICompatWsV2] native binding loaded from ${moduleId}`)
87 return validBinding
88 }
89 } catch {
90 // Try the next source/bundled/native layout candidate.
91 }
92 }
93 logForDebugging('[OpenAICompatWsV2] native binding unavailable')
94 return null
95}
96
97export function loadNativeBindingForTesting(): NativeWsV2Binding | null {
98 return loadNativeBinding()

Calls 3

validateNativeBindingFunction · 0.85
logForDebuggingFunction · 0.50

Tested by

no test coverage detected