クイックスタート
クイックスタート
とりあえず始めてみたい方へ。すぐに取りかかるために必要なものをすべてまとめました。
試す:Playground
- Playground を開いてログインします。
- 任意のテキストを貼り付けます(state として)。
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.
- 質問を追加します。 Noul の質問を試してみましょう:
"Does this message express urgency?"
{
"urgency": {
"type": "noul",
"instructions": "Does this message express urgency?"
}
}
- 質問をさらに追加します。 Noul・Choice・Score を一つの呼び出しに混ぜると、すべての結果を一度に確認できます。
呼び出す:API
- ダッシュボード で API キーを取得します
- API エンドポイントに POST リクエストを送ります
- 詳細は API リファレンス を確認してください。
POST https://api.typesafe.ai/v1/systemone
Authorization: Bearer <API_KEY>
Content-Type: application/json
curl コマンドの例
curl -X POST https://api.typesafe.ai/v1/systemone \
-H "Authorization: Bearer $TYPESAFE_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<'EOF'
{
"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.",
"model": "jev-latest",
"questions": {
"urgency": {
"type": "noul",
"instructions": "Does this message express urgency?"
}
}
}
EOF
リクエストボディ
{
"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.",
"model": "jev-latest",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this",
"criteria": {
"billing": "Payment or subscription issues",
"technical": "Bugs or integration problems",
"sales": "Pricing or account questions"
}
},
"frustration": {
"type": "score",
"instructions": "How frustrated the customer appears",
"criteria": [
"Calm, just stating facts",
"Frustrated but civil",
"Very angry, strong language"
]
},
"is_urgent": {
"type": "noul",
"instructions": "The message conveys urgency or time-sensitivity"
}
}
}
レスポンスボディ
{
"model": "jev-1.13.0",
"answers": {
"department": {
"type": "choice",
"choice": "technical",
"confidence": 0.78,
"probabilities": {
"technical": 0.85,
"sales": 0.0,
"billing": 0.15
}
},
"frustration": {
"type": "score",
"score": 1.0,
"confidence": 1.0,
"legend": {
"0": "Calm, just stating facts",
"1": "Frustrated but civil",
"2": "Very angry, strong language"
},
"probabilities": {
"0": 0.0,
"1": 1.0,
"2": 0.0
}
},
"is_urgent": {
"type": "noul",
"noul": 1.0
}
},
"usage": {
"input_tokens": 392,
"output_tokens": 65
}
}
詳細は API リファレンス を参照してください。
コードで書く:Python SDK
- SDK をインストールします(Python >= 3.10 が必要です)。
pip を使う場合
pip install typesafe-sdk
uv を使う場合
uv add typesafe-sdk
- SDK を使います。 クライアントは環境変数
TYPESAFE_API_KEYを読み込み、デフォルトでjev-latestを呼び出します。
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
インストール方法と詳しい使い方はクライアント SDKを参照してください。
エージェントに任せる:agent skill
- TypeSafe skill をインストールします。Claude Code のプラグインを使うか、
npx skills add typesafe-ai/skills --skill typesafe-aiを実行します。GitHub で SKILL.md を読むこともできます。
ターミナルで次の二つのコマンドを実行します:
claude plugin marketplace add typesafe-ai/skills
claude plugin install typesafe@typesafe-ainpx skills add typesafe-ai/skills --skill typesafe-aiプロンプトが出たらエージェントを選択します。インストールはデフォルトでプロジェクト単位です。グローバルにインストールするには -g を付けます。
次のプロンプトをコーディングエージェントに貼り付けます:
Install the TypeSafe skill. If you're in Claude Code, run `claude plugin marketplace add typesafe-ai/skills`, then `claude plugin install typesafe@typesafe-ai`. If you're in another agent, run `npx skills add typesafe-ai/skills --skill typesafe-ai` and select your agent. Use one installation method. You can read the skill directly at https://github.com/typesafe-ai/skills/blob/main/skills/typesafe-ai/SKILL.md (raw: https://raw.githubusercontent.com/typesafe-ai/skills/main/skills/typesafe-ai/SKILL.md). Then use the TypeSafe skill when working on this project.- コーディングエージェントに伝えます。構築の際に TypeSafe skill を使うように指示しましょう。
コーディングエージェントへのプロンプト
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.
詳細は Agent Skill ページを参照してください。