テキスト
Evaluate Decisions
ネイティブの決定モデルを使用して、名前付きの確率、選択、およびスコアの質問を評価します。
state と名前付きの questions を決定モデルに送信します。現在の利用可能性については GET /v1/models?category=decision を、公開されているコントラクトについては GET /v1/models/{model} を使用してください。
Jevには、安定版の jev-1.14(リクエストエイリアス jev-latest および jev-preview)と、旧バージョンの jev-1.13 という2つのバージョンがあります。例では jev-1.13 を使用しています。どちらを選択するかについては、決定 を参照してください。
state および各質問の instructions は、文字列、JSONオブジェクト、またはJSON配列を受け入れます。このエンドポイントは同期的にJSONを返します。
| 質問タイプ | 基準 | 結果 |
|---|---|---|
noul | true と false の両方のガイダンスを含むオプションのオブジェクト | noul、0から1までの確率 |
choice | ガイダンスまたは null にマッピングされた1〜255個のオプション名のオブジェクト | choice、オプションで probabilities および confidence |
score | 2〜10個の説明の順序付き配列 | 0から最後のインデックスまでの score。小数になる場合があり、オプションで legend、probabilities、confidence が含まれます |
レスポンスでは、質問名が answers の下に保持されます。usage.input_tokens および usage.output_tokens は、利用可能な場合に観測された使用量を報告します。価格はモデルの現在の料金表に基づきます。出力が無料であっても、出力トークンがゼロであることを意味するわけではありません。
チャットメッセージ、ツール、ストリーミング、および Batch は、このエンドポイントのコントラクトには含まれません。
curl https://api.tokenlab.sh/v1/systemone \
-H "Authorization: Bearer $TOKENLAB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev-1.13",
"state": "I was charged twice. Please refund the duplicate payment.",
"questions": {
"refund_requested": {"type": "noul", "instructions": "Is a refund requested?"},
"department": {
"type": "choice", "instructions": "Which team should handle this?",
"criteria": {"refunds": "Charges and refunds", "technical": "Software bugs"}
},
"urgency": {
"type": "score", "instructions": "Rate urgency",
"criteria": ["Routine enquiry", "Money affected", "Safety emergency"]
}
}
}'このHTTPリクエストは、標準の fetch や requests クライアントでも使用可能です。決定レスポンスは構造化データであり、生成されたテキストによる説明ではありません。
レスポンスの例。値は例示です:
{
"model": "jev-1.13",
"answers": {
"refund_requested": { "type": "noul", "noul": 0.97 },
"department": {
"type": "choice",
"choice": "refunds",
"probabilities": { "refunds": 0.93, "technical": 0.07 },
"confidence": 0.93
},
"urgency": { "type": "score", "score": 1.2, "confidence": 0.7 }
},
"usage": { "input_tokens": 412, "output_tokens": 38 }
}エラー
リクエストに不明なフィールドや無効な質問が含まれている場合、400 invalid_request で拒否されます。決定モデルではないモデルを指定した場合は 400 unsupported_endpoint が返されます。その他のステータスについては APIエラーの処理 に従って処理してください。
curl -X POST "https://example.com/v1/systemone" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "state": "string", "questions": { "property1": { "type": "noul", "instructions": "string" }, "property2": { "type": "noul", "instructions": "string" } } }'{ "id": "string", "model": "string", "answers": { "property1": { "type": "noul", "noul": 0 }, "property2": { "type": "noul", "noul": 0 } }, "usage": { "input_tokens": 0, "output_tokens": 0 }}認証
BearerAuth APIキー認証。Dashboard > API > API KeysでAPIキーを作成または管理します。
場所: header
ヘッダー
リクエストごとの配信ポリシー。APIキーおよびWorkspaceのデフォルト設定を上書きします。自動的にまず TokenLab Verified を試行し、出力、リクエストの受け入れ、または永続的なリソース作成の前に、一度だけ Official に切り替える場合があります。
指定できる値
- "auto"
- "verified"
- "official"
リクエストボディ
application/json
レスポンス
application/json
application/json
application/json
application/json
application/json
application/json
application/json