开源复现
开源的 System One 决策模型,非自回归,响应时间低于15毫秒,可本地替代 TypeSafe Jev。
The open-source System One decision model. Sub-15ms, non-autoregressive, local drop-in alternative to TypeSafe Jev.
* Evaluates state and questions via System One wire protocol (POST /v1/systemone).链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
取自 examples/intent_routing.py:3
intent选项What does the author of `message` want?
order_status — Where is my order, has it shipped, tracking lookupproduct_question — How a product works, compatibility, specsreturn_exchange — Return, exchange, or replace an itemcomplaint — Unhappy with service or product, wants a resolutionneeds_reasoning打分How much thought does a good answer to `message` need?
0 — A lookup or a one-line fact1 — A short explanation using product knowledge2 — A judgment call with trade-offs or an unhappy customerimport { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
intent: { type: 'choice', instructions: 'What does the author of `message` want?',
criteria: { order_status: 'Where is my order, has it shipped, tracking lookup', product_question: 'How a product works, compatibility, specs', return_exchange: 'Return, exchange, or replace an item', complaint: 'Unhappy with service or product, wants a resolution' } },
needs_reasoning: { type: 'score', instructions: 'How much thought does a good answer to `message` need?',
criteria: ['A lookup or a one-line fact', 'A short explanation using product knowledge', 'A judgment call with trade-offs or an unhappy customer'] },
},
});取自 examples/sponsor_form.py:10
is_sponsor_inquiry是/否Does `description` ask to sponsor the site or newsletter?
product_category选项What kind of product is described by `name` and `description`?
dev_tool — Developer tools, hosting, APIs, SaaS for developerscourse — Courses, books, or trainingunrelated — Anything not aimed at developersmessage_quality打分How specific is the request?
0 — Generic template, no reference to this site1 — Mentions the site but no concrete ask2 — Concrete ask with a timeframe or product namedimport { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
is_sponsor_inquiry: { type: 'boolean', instructions: 'Does `description` ask to sponsor the site or newsletter?' },
product_category: { type: 'choice', instructions: 'What kind of product is described by `name` and `description`?',
criteria: { dev_tool: 'Developer tools, hosting, APIs, SaaS for developers', course: 'Courses, books, or training', unrelated: 'Anything not aimed at developers' } },
message_quality: { type: 'score', instructions: 'How specific is the request?',
criteria: ['Generic template, no reference to this site', 'Mentions the site but no concrete ask', 'Concrete ask with a timeframe or product named'] },
},
});取自 tests/test_patterns_presets.py:63
is_outage是/否Is there an active database outage?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
is_outage: { type: 'boolean', instructions: 'Is there an active database outage?' },
},
});取自 tests/test_patterns_presets.py:78
severity打分Rate outage severity
0 — Minor1 — Moderate2 — Critical emergencyblocking是/否Is this blocking?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
severity: { type: 'score', instructions: 'Rate outage severity',
criteria: ['Minor', 'Moderate', 'Critical emergency'] },
blocking: { type: 'boolean', instructions: 'Is this blocking?' },
},
});