UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.09 kB
import{_ as runPluginStreamConsumer}from"./plugin-instance-scope-Bx-frH07.mjs";import{r as bindStreamLlmRuntime}from"./model-runtime-binding-C5v05rsT.mjs";import{createApiRegistry,createLlmRuntime}from"@openclaw/ai";import{registerBuiltInApiProviders}from"@openclaw/ai/providers"; //!src/agents/sessions/model-registry-runtime.ts const modelRegistryRuntimes=/* @__PURE__ */ new WeakMap;function resetApiRegistry(e){e.apiRegistry.clearApiProviders();registerBuiltInApiProviders(e.apiRegistry)}function initializeModelRegistryRuntime(e){const t=createApiRegistry();const n={...createLlmRuntime(t),runStream:runPluginStreamConsumer};const r={apiRegistry:t,llmRuntime:n};bindStreamLlmRuntime(n.streamSimple,n);resetApiRegistry(r);modelRegistryRuntimes.set(e,r)}function getModelRegistryRuntime(e){const t=modelRegistryRuntimes.get(e);if(!t)throw new Error(`Model registry runtime is not initialized`);return t}function resetModelRegistryRuntime(e){resetApiRegistry(getModelRegistryRuntime(e))}export{initializeModelRegistryRuntime as n,resetModelRegistryRuntime as r,getModelRegistryRuntime as t};