J
新手入门 浏览案例库
怎么用 最后更新 2026-09-21

第一次用 Jev,从哪开始?

不用先把文档读完。官方给了四条路,挑最顺手的走,五分钟能跑通。

第一步 去官网拿一个 API key (https://typesafe.ai/)

官网首页点 Join Waitlist(官方叫 early access)。通过后会收到一封「You're in!」的邮件,点进去建账号,然后在控制台里的 Keys 页面复制那串 apikey_...。已经有 key 的人,直接去 console.typesafe.ai 登录就能拿。

四条路适合谁要做什么
① Playground先试试,不写代码打开网页,粘一段文本,加一个问题
② API要接进自己的服务拿 key,POST 一个请求
③ SDK写 Python 的pip 装一个包,三行代码出结果
④ Agent Skill想让 coding agent 替你接装官方 skill,把一段提示词发给它

四条路都来自官方 Quick start 页,地址和命令照原文抄的。② 和 ③ 需要第一步拿到的那串 key,① 和 ④ 不需要。

先试一下,不写代码

  1. 打开官方的 Playground 并登录。
  2. 把任意一段文本粘进 state。官方示例用的是一段真实的客服抱怨。
  3. 加一个问题,先试最简单的 Noul。
  4. 再混着加 Choice 和 Score,一个请求里一次看全部结果。
json
{
  "state": "Hi, I've been trying to connect my Stripe account for 3 days and the integration keeps failing. I'm losing sales. Please help ASAP.",
  "questions": {
    "urgency": {
      "type": "noul",
      "instructions": "Does this message express urgency?"
    }
  }
}

拿 key,发一个请求

  1. dashboard 里拿 API key。
  2. POST 到 https://api.typesafe.ai/v1/systemone,请求头带上 Authorization: Bearer <你的 key>
  3. 其余细节查官方的 API 参考
bash
curl -X POST https://api.typesafe.ai/v1/systemone \n  -H "Authorization: Bearer $TYPESAFE_API_KEY" \n  -H "Content-Type: application/json" \n  -d @request.json

用官方 SDK

需要 Python 3.10 以上。客户端会自己从环境变量 TYPESAFE_API_KEY 读 key,默认用 jev-latest 这个模型。

bash
# 二选一
pip install typesafe-sdk
uv add typesafe-sdk
python
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient

client = TypeSafeClient()

ticket = "Hi, I've been trying to connect my Stripe account for 3 days and the integration keeps failing. I'm losing sales. Please help ASAP."

response = client.system_one(
    state=ticket,
    questions={
        "department": Choice(
            instructions="Which team should handle this",
            criteria={
                "billing": "Payment or subscription issues",
                "technical": "Bugs or integration problems",
                "sales": "Pricing or account questions",
            },
        ),
        "frustration": Score(
            instructions="How frustrated the customer appears",
            criteria=[
                "Calm, just stating facts",
                "Frustrated but civil",
                "Very angry, strong language",
            ],
        ),
        "is_urgent": Noul(
            instructions="The message conveys urgency or time-sensitivity",
        ),
    },
)

print(response.answers["department"].choice)   # "technical"
print(response.answers["frustration"].score)   # 1.0
print(response.answers["is_urgent"].noul)      # 1.0

让 coding agent 替你接

官方把这条路做成了一个 skill。装完之后,把下面那段提示词原样粘给你的 agent,它就知道怎么用了。

bash
# 通用(会问你用哪个 agent)
npx skills add typesafe-ai/skills --skill typesafe-ai

# Claude Code 用户也可以走插件
claude plugin marketplace add typesafe-ai/skills
claude plugin install typesafe@typesafe-ai
text
Let's build a simple CLI that uses the TypeSafe API to evaluate a set of supplied documents on multiple dimensions. Use the TypeSafe skill to understand how to use the TypeSafe API and how to structure the system. Ask me questions about what kinds of documents I want to evaluate and on what dimensions.
实测 我们照官方示例跑了一遍

用的就是官方文档里那段 Stripe 客服抱怨,三个问题一次问完。

department(choice)
technical,confidence 0.77(billing 0.15 / technical 0.85)。官方注释写的就是 "technical"
frustration(score)
1.0。官方注释写的也是 1.0
is_urgent(noul)
0.99。官方注释写 1.0,我们差一点点

耗时 0.64 秒,输入 425 tokens,输出 73 tokens。三行注释里两行完全一致、一行差 0.01。它给的是概率,不是结论。0.99 和 1.0 在业务上没有区别,但你的代码要按概率写。

第一次跑通之后,最容易卡的地方在提问的措辞上。我们在这上面栽过,具体看三种问题类型那一页。

看看别人怎么用 Jev(74 个案例)

事实来源

下面这些是官方文档,本页所有事实性描述都可回溯到这里(其他内容站的说法未经核实,我们不用)。