开源复现

reflex

@kshetrajna1280PythonMIT更新于 2026-09-20可当场跑

一个小型开放决策模型:状态加类型化问题输入,输出校准概率,基于Qwen3.5重现Jev和System One。

英文原文

A small open decision model: state + typed questions -> calibrated probabilities. A Jev / System One re-creation on Qwen3.5.

kshetrajna12/reflex

它在哪儿调用了 Jev

"/v1/systemone", json={"model": model, "state": state, "questions": questions, **extra}

src/reflex/client.py:18

链接指向我们抓取当天的那个 commit,行号是准的。

它问 Jev 的问题

下面是从这个项目源码里原样取出来的 question 组合。

取自 docs/app.js:18

  1. queue选项

    Which team should handle this ticket?

    • paymentsPayouts, refunds, invoices, failed charges
    • accountLogin, profile, permissions, 2FA
    • otherAnything else
  2. escalate是/否

    Should this ticket be escalated to a human manager right away?

  3. urgency打分

    How urgent is this ticket?

    • 0Low: can wait several days
    • 1Medium: should be handled today
    • 2High: money or access is blocked right now
  4. refund_requested是/否

    Does the customer explicitly ask for a refund?

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    queue: { type: 'choice', instructions: 'Which team should handle this ticket?',
      criteria: { payments: 'Payouts, refunds, invoices, failed charges', account: 'Login, profile, permissions, 2FA', other: 'Anything else' } },
    escalate: { type: 'boolean', instructions: 'Should this ticket be escalated to a human manager right away?' },
    urgency: { type: 'score', instructions: 'How urgent is this ticket?',
      criteria: ['Low: can wait several days', 'Medium: should be handled today', 'High: money or access is blocked right now'] },
    refund_requested: { type: 'boolean', instructions: 'Does the customer explicitly ask for a refund?' },
  },
});

取自 docs/app.js:28

  1. subject选项

    What is the main subject of the photo?

    • landscapeoutdoor scenery, nature, cityscape
    • documenttext, screenshot, receipt
    • productan object for sale, packaging
  2. contains_text是/否

    Does the image contain readable text?

  3. matches_caption是/否

    Does the `caption` in the state accurately describe the photo?

  4. quality打分

    How good is the technical image quality?

    • 0Unusable: extremely blurry, dark, or corrupted
    • 1Poor: noticeable blur, noise, or bad exposure
    • 2Acceptable: minor flaws
    • 3Good: sharp and well exposed

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    subject: { type: 'choice', instructions: 'What is the main subject of the photo?',
      criteria: { landscape: 'outdoor scenery, nature, cityscape', document: 'text, screenshot, receipt', product: 'an object for sale, packaging' } },
    contains_text: { type: 'boolean', instructions: 'Does the image contain readable text?' },
    matches_caption: { type: 'boolean', instructions: 'Does the `caption` in the state accurately describe the photo?' },
    quality: { type: 'score', instructions: 'How good is the technical image quality?',
      criteria: ['Unusable: extremely blurry, dark, or corrupted', 'Poor: noticeable blur, noise, or bad exposure', 'Acceptable: minor flaws', 'Good: sharp and well exposed'] },
  },
});

取自 docs/app.js:38

  1. has_blue是/否

    Is there a blue shape in the photo?

  2. clutter打分

    How cluttered is the photo?

    • 0empty or one or two simple shapes
    • 1several objects
    • 2very busy scene

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    has_blue: { type: 'boolean', instructions: 'Is there a blue shape in the photo?' },
    clutter: { type: 'score', instructions: 'How cluttered is the photo?',
      criteria: ['empty or one or two simple shapes', 'several objects', 'very busy scene'] },
  },
});

取自 docs/pr.js:5

  1. kind选项

    What kind of change is this pull request, judging from the title, description and the files touched?

    • featureadds new user-facing behaviour or capability
    • bugfixcorrects incorrect behaviour
    • refactorrestructures code without changing behaviour
    • docsdocumentation, comments, changelog only
    • testsadds or changes tests only
    • chorebuild, CI, dependencies, formatting, release plumbing
  2. description_matches是/否

    Does the `body` accurately describe what the changed `files` and `stats` suggest the PR does?

  3. breaking_change是/否

    Is this likely a breaking change for users of this project (public API, config format, CLI flags, behaviour that callers rely on)?

  4. needs_migration是/否

    Does this change need a data or schema migration, or a coordinated rollout (e.g. database, stored formats, protocol versions)?

  5. risk打分

    How risky is merging this PR, considering scope, the areas touched and how easy it is to reason about?

    • 0trivial: docs, comments, formatting, isolated tests
    • 1low: small, local, easy to reason about
    • 2medium: touches shared logic or several files; a careful review is warranted
    • 3high: core behaviour, data handling, security, or concurrency; could break users

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    kind: { type: 'choice', instructions: 'What kind of change is this pull request, judging from the title, description and the files touched?',
      criteria: { feature: 'adds new user-facing behaviour or capability', bugfix: 'corrects incorrect behaviour', refactor: 'restructures code without changing behaviour', docs: 'documentation, comments, changelog only', tests: 'adds or changes tests only', chore: 'build, CI, dependencies, formatting, release plumbing' } },
    description_matches: { type: 'boolean', instructions: 'Does the `body` accurately describe what the changed `files` and `stats` suggest the PR does?' },
    breaking_change: { type: 'boolean', instructions: 'Is this likely a breaking change for users of this project (public API, config format, CLI flags, behaviour that callers rely on)?' },
    needs_migration: { type: 'boolean', instructions: 'Does this change need a data or schema migration, or a coordinated rollout (e.g. database, stored formats, protocol versions)?' },
    risk: { type: 'score', instructions: 'How risky is merging this PR, considering scope, the areas touched and how easy it is to reason about?',
      criteria: ['trivial: docs, comments, formatting, isolated tests', 'low: small, local, easy to reason about', 'medium: touches shared logic or several files; a careful review is warranted', 'high: core behaviour, data handling, security, or concurrency; could break users'] },
  },
});

同类的其他项目