본문으로 건너뛰기

Playground

캐릭터는 다음에 무엇을 해야 하나요?

캐릭터는 다음에 무엇을 해야 하나요? 체력이 낮으면 물약을 마시고, 높으면 공격합니다.

이 샘플이 보여주는 것. 게임 AI에는 "고정 목록에서 한 수를 고르는" 결정이 많고, 대개 if-else로 짜입니다. 여기서는 캐릭터 상태를 의사결정 모델에 단일 Choice 질문으로 보냅니다: 공격, 물약 마시기, 도망, 휴전 요청, 도발. 게임 루프가 그대로 실행할 행동 하나와 각 선택지 확률을 받습니다.

샘플 입력과 결과(샘플 데이터, 라이브 모델 실행 아님). 국경 경비병이 좁은 다리에 서 있고 체력 12%, 적 3명, 회복 물약 1, 근처 아군 없음. 결과: 물약 마시기 58%. 도망 24%, 휴전 9%, 공격 7%, 도발 2%. 체력만 80%로 바꾸면 공격 64%로 뒤집히고, 도발 18%, 물약은 3%.

확률이 중요한 이유. 저체력에서는 물약이 58%로 이기고 도망도 24%입니다. 분포에서 샘플링하거나, 최상위가 충분히 자신 있지 않으면 스크립트 규칙으로 돌아가 매번 같은 행동을 피합니다.

이 접근이 맞는 때. 상태가 몇 필드로 들어가고, 행동이 고정이며, 긴 추론 문단이 아니라 실행 가능한 답이 필요할 때. 샘플 요청은 Decider(decider-v1.1). 상태에 스크린샷이 있으면 이미지를 받는 Clef 모델로 바꾸세요.

자주 묻는 질문

이 페이지의 확률은 실시간 계산인가요?

아니요. 샘플 데이터이며 모델을 바꿔도 변하지 않습니다. 자신의 게임 상태를 실행하려면 로그인하세요.

직접 행동을 정의할 수 있나요?

네. 모델은 criteria에 나열한 항목 중에서 고릅니다. 선택지 최대 개수는 각 모델의 Model info에 있습니다.

매 프레임 호출해도 저렴한가요?

비용은 요청 크기와 질문 수에 따라 달라집니다. 요금을 보세요. 매 프레임 호출 전에 게임에서 지연을 측정하세요.

샘플 결과는 선택한 모델에 따라 바뀌지 않습니다.

요청

state
application/json
{  "npc": "Border guard",  "hp": "12%",  "enemies": 3,  "inventory": {    "healing_potion": 1  },  "terrain": "narrow bridge",  "ally_nearby": false}

결과

샘플 데이터
두 예제 비교

이 두 예시는 세부 사항 하나만 다릅니다. 결과가 그에 따라 바뀝니다.

무엇이 바뀌었는지낮은 체력 → 높은 체력

이 결과는 샘플 데이터이며 라이브 모델 실행이 아닙니다. 로그인하면 자신의 콘텐츠로 시도할 수 있습니다.
action: attack · 공격 → potion · 물약 마시기
actionchoice
potion · 물약 마시기
옵션별 신뢰도
공격
7%
물약 마시기
58%
도망
24%
휴전 요청
9%
도발
2%

코드 복사

SYSTEM_ONE_API_KEY를 설정하세요. 스니펫은 게시된 카탈로그 모델 ID를 사용합니다.

요청 JSON
application/json
{"model":"decider-v1.1","state":{"npc":"Border guard","hp":"12%","enemies":3,"inventory":{"healing_potion":1},"terrain":"narrow bridge","ally_nearby":false},"questions":{"action":{"type":"choice","instructions":"Choose the NPC's next action given the game state.","criteria":{"attack":"공격","potion":"물약 마시기","flee":"도망","parley":"휴전 요청","taunt":"도발"}}}}
cURL · POST /v1/systemone
sh
curl "https://system-one.dev/v1/systemone" \  -H "Authorization: Bearer $SYSTEM_ONE_API_KEY" \  -H 'Content-Type: application/json' \  -H 'Idempotency-Key: saved-operation-id' \  --data '{"model":"decider-v1.1","state":{"npc":"Border guard","hp":"12%","enemies":3,"inventory":{"healing_potion":1},"terrain":"narrow bridge","ally_nearby":false},"questions":{"action":{"type":"choice","instructions":"Choose the NPC'\''s next action given the game state.","criteria":{"attack":"공격","potion":"물약 마시기","flee":"도망","parley":"휴전 요청","taunt":"도발"}}}}'
TypeScript
TypeScript
// npm install @system-one-ai/core@0.8.0 @system-one-ai/adapter-system-one@0.7.0 @system-one-ai/transport-fetch@0.8.0import { createSystemOne, choice, score, booleanQuestion } from '@system-one-ai/core';import { systemOneAdapter } from '@system-one-ai/adapter-system-one';import { createFetchTransport } from '@system-one-ai/transport-fetch';const client = createSystemOne({  baseURL: "https://system-one.dev/v1",  apiKey: process.env.SYSTEM_ONE_API_KEY!,  model: "decider-v1.1",  adapter: systemOneAdapter,  transport: createFetchTransport(),  timeoutMs: 30_000,  maxRetries: 0,});const result = await client.evaluate({  state: {    "npc": "Border guard",    "hp": "12%",    "enemies": 3,    "inventory": {      "healing_potion": 1    },    "terrain": "narrow bridge",    "ally_nearby": false  },  questions: {  action: choice("Choose the NPC's next action given the game state.", {    attack: "공격",    potion: "물약 마시기",    flee: "도망",    parley: "휴전 요청",    taunt: "도발",  }),  },}, { headers: { 'Idempotency-Key': crypto.randomUUID() } });result.answers.action.choiceresult.response.requestId;