All Products
Search
Document Center

Alibaba Cloud Model Studio:API Model Keputusan

Last Updated:Oct 16, 2026

Panggil POST /compatible-mode/v1/systemone untuk menggunakan model keputusan Bailian (decision-model-preview), yang mengembalikan klasifikasi, skor, dan keputusan ya/tidak beserta distribusi probabilitas lengkap dan tingkat keyakinan dalam satu kali forward pass tanpa menghasilkan teks. Cocok untuk keputusan terstruktur berfrekuensi tinggi seperti perutean tiket, moderasi konten, perutean agen, dan verifikasi hasil.

Prasyarat

Anda telah membuat API Key dan menetapkannya sebagai variabel lingkungan DASHSCOPE_API_KEY. Untuk informasi selengkapnya, lihat Mengonfigurasi API key dalam variabel lingkungan.

Permintaan

Protokol: TypeSafe System One (POST /compatible-mode/v1/systemone)

Satu permintaan memuat state bisnis dan beberapa pertanyaan bertipe (choice / noul / score). Model mengembalikan hasil keputusan dan distribusi probabilitas setiap pertanyaan dalam satu kali forward pass. choice dan score juga mengembalikan tingkat keyakinan. Model tidak menghasilkan teks, sehingga latensi dan biaya tidak bergantung pada panjang output.

Endpoint

Ganti {WorkspaceId} dengan ID workspace Anda. Lihat Wilayah dan endpoint.

Wilayah

Endpoint

Singapura

https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/systemone

Tiongkok (Beijing)

https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/systemone

Parameter Permintaan

Content-Type · String · Header · Wajib

Jenis permintaan: application/json.

Authorization · String · Header · Wajib

API key, dengan format: Bearer $DASHSCOPE_API_KEY.

model · String · Isi · Wajib

Nama model: decision-model-preview.

state · String / Object / Array · Isi · Wajib

Status bisnis yang menjadi dasar keputusan: teks tiket, percakapan, atau objek terstruktur (objek diserialisasi sebelum dikirim ke model).

questions · Object · Isi · Wajib

Peta pertanyaan. Kunci adalah ID pertanyaan yang ditentukan pemanggil; nilainya berupa objek pertanyaan dengan field berikut.

Properti objek pertanyaan

type · String · Wajib

Jenis pertanyaan:

  • choice: pilihan tunggal
  • noul: ya/tidak
  • score: skala ordinal

instructions · String · Opsional

Deskripsi pertanyaan atau kriteria penilaian.

criteria · Object / Array · Bergantung pada jenis

  • choice: peta nama opsi → deskripsi opsi (1–255 item; disarankan menyediakan semua opsi dan opsi cadangan other).
  • noul: deskripsi opsional {"true":…, "false":…}.
  • score: array deskripsi tingkat dari rendah ke tinggi (2–10 tingkat; disarankan 3–7 tingkat yang dapat dibedakan dengan jelas).
Batas dan rekomendasi
  • Tidak ada batas tetap untuk jumlah pertanyaan (disarankan: ≤ 16; latensi meningkat hampir secara linear terhadap jumlah pertanyaan).
  • choice opsi: ≤ 255.
  • score tingkat: 2–255 (disarankan 3–7).
  • Konteks: maksimum 65536 token; state yang terlalu panjang ditolak atau dipotong.

Contoh Permintaan

Contoh Python menggunakan TypeSafe SDK (typesafe-sdk) dengan base_url mengarah ke gateway Bailian. SDK otomatis menambahkan /v1/systemone dan mengurai respons. Instal dengan pip install typesafe-sdk.

Perutean tiket

Satu permintaan menangani tiga keputusan sekaligus: penugasan tim (choice), eskalasi (noul), dan tingkat keparahan (score). Contoh berikut menggunakan wilayah Singapura.

curl -sS -X POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/systemone \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "decision-model-preview",
    "state": {"ticket_id": "T-1001", "content": "More than 24 hours after payment, the order has not been credited. The user cannot continue using core services and demands immediate handling."},
    "questions": {
      "department": {"type": "choice", "instructions": "Which team should handle this?",
                     "criteria": {"billing": "Payment, refund, and billing issues", "technical": "Product failure and integration issues"}},
      "escalate":   {"type": "noul",  "instructions": "Should on-call staff be notified immediately?"},
      "severity":   {"type": "score", "instructions": "How severe is this issue?",
                     "criteria": ["Minor issue, no impact on functionality", "Some functionality affected, but a workaround exists",
                                  "Core functionality unavailable, no workaround", "Severe business or security impact"]}
    }
  }'
import os
from typesafe_sdk import TypeSafeClient

client = TypeSafeClient(
    api_key=os.environ["DASHSCOPE_API_KEY"],
    base_url="https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode",
)

result = client.system_one(
    model="decision-model-preview",
    state={"ticket_id": "T-1001", "content": "More than 24 hours after payment, the order has not been credited."},
    questions={
        "department": {"type": "choice", "instructions": "Which team should handle this?",
                       "criteria": {"billing": "Payment, refund, and billing issues", "technical": "Product failure and integration issues"}},
        "escalate": {"type": "noul", "instructions": "Should on-call staff be notified immediately?"},
        "severity": {"type": "score", "instructions": "How severe is this issue?",
                     "criteria": ["Minor issue, no impact on functionality", "Some functionality affected, but a workaround exists",
                                  "Core functionality unavailable, no workaround", "Severe business or security impact"]},
    },
)

print(result.answers["department"])   # choice, confidence, probabilities
print(result.answers["escalate"])     # noul P(yes)
print(result.answers["severity"])     # score, legend, probabilities

Keputusan ya/tidak

Pertanyaan noul mengembalikan P(yes), dengan 0 = tidak dan 1 = ya. Contoh berikut menggunakan wilayah Singapura.

curl -sS -X POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/systemone \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "decision-model-preview",
    "state": "Is this comment asking for a refund?",
    "questions": {
      "refund": {"type": "noul", "instructions": "Is the user asking for a refund?"}
    }
  }'
import os
from typesafe_sdk import TypeSafeClient

client = TypeSafeClient(
    api_key=os.environ["DASHSCOPE_API_KEY"],
    base_url="https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode",
)

result = client.system_one(
    model="decision-model-preview",
    state="Is this comment asking for a refund?",
    questions={"refund": {"type": "noul", "instructions": "Is the user asking for a refund?"}},
)

print(result.answers["refund"])   # noul P(yes)

Parameter Respons

model · String

Nama model yang dikembalikan.

request_id · String

ID permintaan untuk pemecahan masalah.

answers · Object

Peta jawaban. Kunci sesuai dengan ID pertanyaan dalam permintaan; nilainya berupa objek jawaban dengan field berikut.

Properti objek jawaban

type · String

Sama dengan jenis pertanyaan (choice / noul / score).

choice · String

Untuk choice: nama opsi yang dipilih.

noul · Float

Untuk noul: P(yes), dengan 0 = tidak dan 1 = ya.

score · Float

Untuk score: nilai harapan indeks tingkat yang dibobot berdasarkan probabilitas, yang dapat berada di antara dua tingkat (misalnya 1.43).

probabilities · Object

Probabilitas setiap opsi/tingkat (totalnya 1).

confidence · Float

Tingkat keyakinan jawaban (dikembalikan untuk choice / score).

legend · Object

Untuk score: peta indeks tingkat → deskripsi tingkat.

usage · Object

Informasi pengukuran penggunaan:

  • input_tokens (Integer): jumlah token input.

latency_ms · Float

Latensi sisi server (milidetik).

Contoh Respons

Berikut adalah respons untuk contoh perutean tiket (disingkat). Probabilitas dan tingkat keyakinan bergantung pada hasil sebenarnya.

{
  "model": "decision-model-preview",
  "request_id": "7b986c65-b223-9341-b5f0-b988e27ecaac",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "billing",
      "confidence": 0.88,
      "probabilities": {"billing": 0.94, "technical": 0.06}
    },
    "escalate": {
      "type": "noul",
      "noul": 0.99
    },
    "severity": {
      "type": "score",
      "score": 2.25,
      "confidence": 0.91,
      "legend": {
        "0": "Minor issue, no impact on functionality",
        "1": "Some functionality affected, but a workaround exists",
        "2": "Core functionality unavailable, no workaround",
        "3": "Severe business or security impact"
      },
      "probabilities": {"0": 0.0, "1": 0.01, "2": 0.73, "3": 0.26}
    }
  },
  "usage": {"input_tokens": 125},
  "latency_ms": 52.9
}

Kode Kesalahan

Jika panggilan gagal, pesan kesalahan akan dikembalikan. Untuk kode kesalahan dan solusi lainnya, lihat Pesan kesalahan.