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.14.0",
"answers": {
"is_urgent": {
"type": "noul",
"noul": 0.49
}
},
"usage": {
"input_tokens": 280,
"output_tokens": 23
}
}
},
"success": true,
"errors": [],
"messages": []
}
Jev
Jev 意思決定 API
- 同期型の意思決定 API であり、チャット API ではありません。ストリーミング出力には対応していません
- 判定材料となる
stateと複数の判定問題questionsを送信すると、1 回のレスポンスで各問題の確率、選択肢、スコア、または画像内の位置を返します - 画像入力および Box 位置特定問題に対応(Beta)
- 呼び出し時のモデル名には
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.14.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.14.0)です。このフィールドはアップストリームから返されるため、リクエストにはバージョン番号を含めないでください。object
必須
判定内容。
state、questions を含み、画像を含める場合は assets も追加します。表示 フィールド説明
表示 フィールド説明
string | object | array
必須
判定対象のデータ。単一のテキスト文のほか、オブジェクトや配列も指定可能です。判定に必要なデータのみを含め、APIキーやパスワードなどの機密情報は含めないでください。画像を含める場合は、
state 内に画像の参照名を記述します(例:{ "photo": "img-7f3a91" })。参照名は assets 内のキーに対応します。object
画像マップ(Beta)。キーは参照名、値は画像オブジェクトです。画像がない場合は渡さないでください。参照名はプレーンテキストとしてマッチングされ、
state、質問の instructions、または criteria 内の任意の文字列に記述できます。モデルはその位置に該当の画像を認識します。参照名には本文と重複しない文字列を選択してください。画像ごとに UUID を使用することをお勧めします。各参照名はリクエスト内に少なくとも1回出現する必要があります。object
必須
質問マップ。空にすることはできません。キー名は自由に設定可能で、各質問はオブジェクト形式です。各質問には
type と instructions が必須です。noul— 正誤判定問題(Yes/No)。「Yes」の確率を示す 0 から 1 の範囲のnoulを返します。criteriaは任意で、{ "true": "どのような場合をYesとするか", "false": "どのような場合をNoとするか" }のような形式です。choice— 単一選択問題。criteriaは必須で、「選択肢名 → 説明」のオブジェクトです。返されるchoiceは選択された選択肢名です。score— スコア評価。criteriaは必須で、低い順に並んだ少なくとも2つの要素を持つ順序付き配列です。返されるscoreは該当する段階を示す数値で、最初の項目が 0 となり、小数も取り得ます。例えば3段階の場合、1.99はほぼ3番目の項目に該当することを示します。box— 画像内の位置検出(Beta)。画像が必須であり、criteriaは受け付けません。instructionsには何を探すか、どの画像内にあるかを記述します(例:"the car in `photo`")。対象を囲むバウンディングボックス(矩形)を返します。
noul、choice、score、box を同時に含めることができます。stream は渡さないでください。本エンドポイントは完全な JSON を一度だけ返します。
Response
レスポンスボディはアップストリームの生 JSON であり、本インターフェースによる改変は行われません。判定結果はresult.result.answers に格納されます。
boolean
今回のリクエストが成功したかどうか
array
エラー一覧。成功時は空の配列
array
追加メッセージ。メッセージがない場合は空の配列
object
アップストリームの実行結果
表示 フィールド説明
表示 フィールド説明
string
実行ステータス。
Completed は完了したことを示しますobject
モデルの回答
表示 フィールド説明
表示 フィールド説明
string
アップストリームで実際に使用されたバージョン番号。例:
jev-1.14.0object
各設問の結果。キー名はリクエスト内の設問名と一致します。
noul:{ "type": "noul", "noul": 0.49 }。0.8以上は「はい」、0.2以下は「いいえ」と見なすことができ、0.5に近い場合は判断がつかないことを示します。choice:choiceは選択された選択肢名、probabilitiesは各選択肢の確率、confidenceは信頼度です。score:scoreはスコア、legendは段階のインデックスを送信されたテキストにマッピングします。box:boxは{ "top", "bottom", "left", "right" }の4辺で、値は 0 から 1 の範囲となり、画像の高さおよび幅に対する相対比率です(原点は左上)。confidenceは信頼度です。枠を描画する際は、各辺に画像のピクセル幅・高さを掛けます。
使用示例
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.14.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": "人的エスカレーションが必要かどうか"
}
}
}
}
图片与 Box 示例(Beta)
画像はassets に配置し、state で参照名を使って指定します。設問内では `photo` でこの画像を参照します。以下の例では、「画像内に車があるか」と「車はどこにあるか」を同時に質問しています。
{
"model": "jev",
"input": {
"state": { "photo": "img-7f3a91" },
"assets": {
"img-7f3a91": {
"type": "image",
"format": "jpg",
"data_base64": "/9j/4AAQSkZJRg..."
}
},
"questions": {
"has_car": {
"type": "noul",
"instructions": "Is there a car in `photo`?"
},
"car": {
"type": "box",
"instructions": "the car in `photo`"
}
}
}
}
answers:
{
"has_car": { "type": "noul", "noul": 0.97 },
"car": {
"type": "box",
"box": { "top": 0.24, "bottom": 0.81, "left": 0.15, "right": 0.74 },
"confidence": 0.74
}
}
noul の設問を1つ追加し、noul が非常に低い場合はそのボックスを無視してください。
画像要件
| 項目 | 制限 |
|---|---|
| フォーマット | PNG または JPEG の静止画像、アニメーションは非対応。WebP、GIF、HEIC などは事前に PNG または JPEG への変換が必要 |
| 1枚のサイズ | デコード後 16 MiB 以内 |
| 幅、高さ | 各辺 280〜1568ピクセル。範囲外の場合は自動縮小されず直接エラー |
| リクエストボディ | JSON と base64 を含めて 32 MiB 以内 |
- 送信前に長辺を 1568ピクセル以内に縮小してください。アップストリーム側で EXIF は削除され、EXIF の向きに応じた回転は行われません。スマートフォンの写真は事前にピクセル自体の向きを正しく回転させてください。
- 画像は入力トークンに換算され、
usage.input_tokensに計上されるとともにコンテキストウィンドウも消費します。約 800ピクセルの画像1枚で約 1500トークンを消費します。 - リクエスト内のいずれかの画像が要件を満たしていない場合、リクエスト全体が失敗となり、部分的な結果が返されることはありません。
注意事项
- 本インターフェースはチャットインターフェースではないため、
messagesやstreamを渡すことはできません。 - 画像入力および Box の問題は現在 Beta であり、リクエスト形式、結果、制限はバージョンによって変更される可能性があるため、本番環境の意思決定に直接使用することはお勧めしません。
- コンテキストウィンドウは 32000 tokens です。
- 業務エラー時でも HTTP ステータスコードが 200 のままになる場合があるため、
successとerrorsの両方を確認してください。認証失敗時は401、modelの欠落または不正な JSON の場合は400、モデルが存在しない場合は404が返されます。