テキスト

決定の評価

ネイティブの決定モデルを使用して、名前付きの確率、選択、およびスコアの質問を評価します。

POST
/v1/systemone

state と名前付きの questions を決定モデルに送信します。現在の利用可能性については GET /v1/models?category=decision を、公開されているコントラクトについては GET /v1/models/{model} を使用してください。

state および各質問の instructions は、文字列、JSONオブジェクト、またはJSON配列を受け入れます。このエンドポイントは同期的にJSONを返します。

質問タイプ基準結果
noultrue と false の両方のガイダンスを含むオプションのオブジェクトnoul、0から1までの確率
choiceガイダンスまたは null にマッピングされた1〜255個のオプション名のオブジェクトchoice、オプションで probabilities および confidence
score2〜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": {"billing": "Charges and refunds", "technical": "Software bugs"}
      },
      "urgency": {
        "type": "score", "instructions": "Rate urgency",
        "criteria": ["Routine enquiry", "Money affected", "Safety emergency"]
      }
    }
  }'

このHTTPリクエストは、標準の fetch や requests クライアントでも使用可能です。決定レスポンスは構造化データであり、生成されたテキストによる説明ではありません。

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
AuthorizationBearer <token>

APIキー認証。Dashboard > API > API KeysでAPIキーを作成または管理します。

場所: header

ヘッダー

X-TokenLab-Delivery-Policy?string

リクエストごとの配信ポリシー。APIキーおよびWorkspaceのデフォルト設定を上書きします。自動的にまず TokenLab Verified を試行し、出力、リクエストの受け入れ、または永続的なリソース作成の前に、一度だけ Official に切り替える場合があります。

指定できる値

  • "auto"
  • "verified"
  • "official"

リクエストボディ

application/json

レスポンス

application/json

application/json

application/json

application/json