feat: unify TCS mother and Zero Core cognition shelf
This commit is contained in:
parent
1cafb87d61
commit
92c4be9b3c
38 changed files with 535 additions and 137 deletions
3
server-tools/tcs-mother-body/model-router.test.mjs
Normal file
3
server-tools/tcs-mother-body/model-router.test.mjs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import test from 'node:test';import assert from 'node:assert/strict';import {ModelRouter} from './model-router.mjs';
|
||||
test('automatic router uses stronger provider for mother and cheaper provider for door without exposing keys',async()=>{const calls=[];const fetchImpl=async(url,options)=>{calls.push({url,body:JSON.parse(options.body),auth:options.headers.authorization});return {ok:true,async json(){return {choices:[{message:{content:'{"schema":"ok"}'}}]};}};};const router=new ModelRouter({fetchImpl,deepseekKey:'deep-secret',openluxKey:'open-secret'});await router.cognize('mother-evolve',{});await router.cognize('door-test',{});assert.match(calls[0].url,/deepseek/);assert.match(calls[1].url,/openlux/);assert.equal(JSON.stringify(router.status()).includes('secret'),false);});
|
||||
|
||||
Loading…
Reference in a new issue