SDK 与客户端
一个异步 LangGraph 工作流,向 TypeSafe 的 Jev 模型发送模拟邮件。
A small async LangGraph workflow that sends a mocked email to TypeSafe's Jev model,
from typesafe_sdk import AsyncTypeSafeClient, Choice, Noul, Scoresrc/typesafe_ai_basic/test_basic.py:3
链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
取自 src/typesafe_ai_basic/test_basic.py:13
billing是/否Is this ticket about billing?
urgency打分How urgent is this ticket?
0 — can wait1 — this week2 — todayimport { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
billing: { type: 'boolean', instructions: 'Is this ticket about billing?' },
urgency: { type: 'score', instructions: 'How urgent is this ticket?',
criteria: ['can wait', 'this week', 'today'] },
},
});