TokenLab

텍스트

의사결정 평가(Evaluate Decisions)

네이티브 의사결정 모델을 사용하여 명명된 확률, 선택 및 점수 질문을 평가합니다.

POST
/v1/systemone

state와 명명된 questions를 의사결정 모델로 전송합니다. 현재 가용성은 GET /v1/models?category=decision을 사용하고, 게시된 계약 내용은 GET /v1/models/{model}을 사용하여 확인하십시오.

Jev에는 두 가지 버전이 있습니다. 안정적인 jev-1.14 (요청 별칭 jev-latest 및 jev-preview)와 이전 버전인 jev-1.13입니다. 예제에서는 jev-1.13을 사용합니다. 두 버전 중 선택하려면 의사 결정를 참조하십시오.

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는 사용 가능한 경우 관찰된 사용량을 보고합니다. 가격은 모델의 현재 요금제를 따릅니다. 무료 출력이라고 해서 출력 토큰이 0인 것은 아닙니다.

채팅 메시지, 도구, 스트리밍 및 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
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

application/json

application/json

application/json