官方仓库
基于 LLM API 的 TypeSafeClient 替代品,可直接替换使用。
Drop-in TypeSafeClient replacement backed by LLM APIs
from typesafe_sdk import (src/system_one_adapter/__init__.py:3
链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
取自 tests/test_client_with_fake_model.py:25
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
positive是/否The book review is positive.
rating打分How favorable the reviewer's overall assessment is.
0 — The reviewer condemns the book and urges readers to avoid it.1 — The reviewer is mostly critical and does not recommend the book.2 — The reviewer expresses mixed or neutral feelings about the book.3 — The reviewer praises the book overall while noting meaningful flaws.4 — The reviewer offers unreserved praise and an emphatic recommendation.genre选项Which genre this review is about.
fiction — A novel or short story.nonfiction — A 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
instruction_probe选项Return the only marker whose state is ACTIVE.
marker_fen — The marker_fen catalog entry.marker_tor — The marker_tor catalog entry.criteria_probe选项Return the correct opaque handling route for the parcel.
route_7q — Use when the handling class is CLASS_CRYSTAL.route_2m — Use 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.' } },
},
});