Official
Drop-in TypeSafeClient replacement backed by LLM APIs
from typesafe_sdk import (src/system_one_adapter/__init__.py:3
The link points at the commit we read, so the line number still holds.
These question sets are lifted from this project's source exactly as written.
from tests/test_client_with_fake_model.py:25
positivetrue/falseThe 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.' },
},
});from tests/test_client_with_live_apis.py:42
positivetrue/falseThe book review is positive.
ratingscoreHow 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.genrechoiceWhich 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.' } },
},
});from tests/test_client_with_live_apis.py:69
instruction_probechoiceReturn the only marker whose state is ACTIVE.
marker_fen — The marker_fen catalog entry.marker_tor — The marker_tor catalog entry.criteria_probechoiceReturn 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.' } },
},
});