官方仓库

system-one-adapter-python

@typesafe-ai177PythonMIT更新于 2026-09-18可当场跑

基于 LLM API 的 TypeSafeClient 替代品,可直接替换使用。

英文原文

Drop-in TypeSafeClient replacement backed by LLM APIs

typesafe-ai/system-one-adapter-python

它在哪儿调用了 Jev

from typesafe_sdk import (

src/system_one_adapter/__init__.py:3

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

它问 Jev 的问题

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

取自 tests/test_client_with_fake_model.py:25

  1. positive是/否

    The review is positive.

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    positive: { type: 'boolean', instructions: 'The review is positive.' },
  },
});

取自 tests/test_client_with_live_apis.py:42

  1. positive是/否

    The book review is positive.

  2. rating打分

    How favorable the reviewer's overall assessment is.

    • 0The reviewer condemns the book and urges readers to avoid it.
    • 1The reviewer is mostly critical and does not recommend the book.
    • 2The reviewer expresses mixed or neutral feelings about the book.
    • 3The reviewer praises the book overall while noting meaningful flaws.
    • 4The reviewer offers unreserved praise and an emphatic recommendation.
  3. genre选项

    Which genre this review is about.

    • fictionA novel or short story.
    • nonfictionA book based on facts, real events, or ideas.

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    positive: { type: 'boolean', instructions: 'The book review is positive.' },
    rating: { type: 'score', instructions: 'How favorable the reviewer\'s overall assessment is.',
      criteria: ['The reviewer condemns the book and urges readers to avoid it.', 'The reviewer is mostly critical and does not recommend the book.', 'The reviewer expresses mixed or neutral feelings about the book.', 'The reviewer praises the book overall while noting meaningful flaws.', 'The reviewer offers unreserved praise and an emphatic recommendation.'] },
    genre: { type: 'choice', instructions: 'Which genre this review is about.',
      criteria: { fiction: 'A novel or short story.', nonfiction: 'A book based on facts, real events, or ideas.' } },
  },
});

取自 tests/test_client_with_live_apis.py:69

  1. instruction_probe选项

    Return the only marker whose state is ACTIVE.

    • marker_fenThe marker_fen catalog entry.
    • marker_torThe marker_tor catalog entry.
  2. criteria_probe选项

    Return the correct opaque handling route for the parcel.

    • route_7qUse when the handling class is CLASS_CRYSTAL.
    • route_2mUse when the handling class is CLASS_STEEL.

用你自己的内容跑一遍

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

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    instruction_probe: { type: 'choice', instructions: 'Return the only marker whose state is ACTIVE.',
      criteria: { marker_fen: 'The marker_fen catalog entry.', marker_tor: 'The marker_tor catalog entry.' } },
    criteria_probe: { type: 'choice', instructions: 'Return the correct opaque handling route for the parcel.',
      criteria: { route_7q: 'Use when the handling class is CLASS_CRYSTAL.', route_2m: 'Use when the handling class is CLASS_STEEL.' } },
  },
});

同类的其他项目