curl https://aireiter.com/api/v1/systemone \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev",
"input": {
"state": "The payment API timed out.",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Does this need a person right now?"
}
}
}
}'
import os
import requests
response = requests.post(
"https://aireiter.com/api/v1/systemone",
headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
json={
"model": "jev",
"input": {
"state": "The payment API timed out.",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Does this need a person right now?",
}
},
},
},
)
print(response.json()["result"]["result"]["answers"])
const response = await fetch("https://aireiter.com/api/v1/systemone", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "jev",
input: {
state: "The payment API timed out.",
questions: {
is_urgent: {
type: "noul",
instructions: "Does this need a person right now?",
},
},
},
}),
});
const data = await response.json();
console.log(data.result.result.answers);
{
"result": {
"state": "Completed",
"result": {
"model": "jev-1.13.0",
"answers": {
"is_urgent": {
"type": "noul",
"noul": 0.49
}
},
"usage": {
"input_tokens": 280,
"output_tokens": 23
}
}
},
"success": true,
"errors": [],
"messages": []
}
Jev
Jev 意思決定インターフェース
- 同期型の意思決定インターフェースであり、チャットインターフェースではありません。ストリーミング出力には対応していません
- コンテキスト
stateと複数の判定問題questionsを送信すると、1回のレスポンスで各問題の確率、選択肢、またはスコアが返されます - 呼び出し時のモデル名には
jevを指定してください
POST
/
api
/
v1
/
systemone
curl https://aireiter.com/api/v1/systemone \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev",
"input": {
"state": "The payment API timed out.",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Does this need a person right now?"
}
}
}
}'
import os
import requests
response = requests.post(
"https://aireiter.com/api/v1/systemone",
headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
json={
"model": "jev",
"input": {
"state": "The payment API timed out.",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Does this need a person right now?",
}
},
},
},
)
print(response.json()["result"]["result"]["answers"])
const response = await fetch("https://aireiter.com/api/v1/systemone", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "jev",
input: {
state: "The payment API timed out.",
questions: {
is_urgent: {
type: "noul",
instructions: "Does this need a person right now?",
},
},
},
}),
});
const data = await response.json();
console.log(data.result.result.answers);
{
"result": {
"state": "Completed",
"result": {
"model": "jev-1.13.0",
"answers": {
"is_urgent": {
"type": "noul",
"noul": 0.49
}
},
"usage": {
"input_tokens": 280,
"output_tokens": 23
}
}
},
"success": true,
"errors": [],
"messages": []
}
Authorizations
string
必須
Body
string
必須
モデル名。
jev と固定で指定します。レスポンス内の result.result.model はアップストリームで実際に使用されたバージョン番号(例:jev-1.13.0)です。このフィールドはアップストリームから返されるため、リクエストにはバージョン番号を含めないでください。object
必須
判定内容。
state と questions を含みます。表示 フィールドの説明
表示 フィールドの説明
string | object | array
必須
判定対象のデータ。1つの文字列でも、オブジェクトや配列でも構いません。判定の完了に必要なデータのみを含め、APIキーやパスワードなどの機密情報は含めないでください。
object
必須
設問リスト(空にすることはできません)。キー名は自由に設定でき、各設問は1つのオブジェクトになります。各設問には
type と instructions が必須です。noul— 二者択一問題。返されるnoulは 0 〜 1 の範囲で、「はい」の確率を表します。criteriaは任意で、形式は{ "true": "どのような場合が「はい」か", "false": "どのような場合が「いいえ」か" }です。choice— 単一選択。criteriaは必須で、「選択肢名 → 説明」のオブジェクトです。返されるchoiceは選択された選択肢名です。score— スコア評価。criteriaは必須で、低い順から並んだ2つ以上の要素を持つ配列です。返されるscoreは該当する段階の数値で、最初の項目は 0 となり、小数も可能です。例えば3段階の場合、1.99はほぼ3番目の項目に該当することを示します。
noul、choice、score を同時に含めることができます。stream は渡さないでください。本エンドポイントは1回の完全なJSONのみを返します。
Response
レスポンスボディは上流のオリジナルの JSON であり、本インターフェースでは変更を加えません。判定結果はresult.result.answers に格納されます。
boolean
リクエストが成功したかどうか
array
エラー一覧。成功時は空の配列
array
追加メッセージ。メッセージがない場合は空の配列
object
上流の実行結果
表示 フィールド説明
表示 フィールド説明
string
実行ステータス。
Completed は完了を表しますobject
モデルの回答
表示 フィールド説明
表示 フィールド説明
string
上流で実際に使用されたバージョン番号(例:
jev-1.13.0)object
各設問の結果。キー名はリクエスト内の設問名と一致します。
noul:{ "type": "noul", "noul": 0.49 }。0.8以上は「はい」、0.2以下は「いいえ」と見なすことができ、0.5に近い値は判断がつかないことを表します。choice:choiceは選択された選択肢名、probabilitiesは各選択肢の確率、confidenceは信頼度です。score:scoreはスコア、legendはランクのインデックスを送信したテキストにマッピングします。
使用示例
curl https://aireiter.com/api/v1/systemone \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev",
"input": {
"state": "The payment API timed out.",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Does this need a person right now?"
}
}
}
}'
import os
import requests
response = requests.post(
"https://aireiter.com/api/v1/systemone",
headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
json={
"model": "jev",
"input": {
"state": "The payment API timed out.",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Does this need a person right now?",
}
},
},
},
)
print(response.json()["result"]["result"]["answers"])
const response = await fetch("https://aireiter.com/api/v1/systemone", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "jev",
input: {
state: "The payment API timed out.",
questions: {
is_urgent: {
type: "noul",
instructions: "Does this need a person right now?",
},
},
},
}),
});
const data = await response.json();
console.log(data.result.result.answers);
{
"result": {
"state": "Completed",
"result": {
"model": "jev-1.13.0",
"answers": {
"is_urgent": {
"type": "noul",
"noul": 0.49
}
},
"usage": {
"input_tokens": 280,
"output_tokens": 23
}
}
},
"success": true,
"errors": [],
"messages": []
}
複数質問の例
choice と score は、noul と同じリクエストに含めることができます。
{
"model": "jev",
"input": {
"state": {
"ticket": "決済APIが断続的にタイムアウトし、データベースのコネクションプールが枯渇に近づいています。"
},
"questions": {
"next_action": {
"type": "choice",
"instructions": "最も安全な次のステップを選択",
"criteria": {
"rollback": "直近の変更をロールバック",
"observe": "監視を継続し、ログをサンプリング"
}
},
"risk": {
"type": "score",
"instructions": "今回の障害のリスクを評価",
"criteria": ["低", "中", "高", "極高"]
},
"escalate": {
"type": "noul",
"instructions": "人的エスカレーションが必要かどうか"
}
}
}
}
注意事项
- 本エンドポイントはチャットエンドポイントではないため、
messagesを渡すことはできず、streamを渡すこともできません。 - コンテキストウィンドウは 32000 トークンです。
- 処理失敗時でも HTTP ステータスコードが 200 のままの場合がありますので、
successとerrorsの両方を確認してください。認証失敗時は401、modelの欠落または不正な JSON の場合は400、モデルが存在しない場合は404が返されます。