SDK 与客户端

jev-game-tools

@Eniip11Python更新于 2026-09-19可当场跑

基于 TypeSafe Jev 的实时游戏驱动实验工具。

英文原文

Experiments in driving real-time games with TypeSafe Jev: a fast

Eniip/jev-game-tools

它在哪儿调用了 Jev

from typesafe_sdk import Choice, Noul, Score, TypeSafeAPIError, TypeSafeClient

src/jev_game_lab/smoke.py:8

链接指向我们抓取当天的那个 commit,行号是准的。

它问 Jev 的问题

下面是从这个项目源码里原样取出来的 question 组合。

取自 src/jev_game_lab/smoke.py:18

  1. action选项

    Pick the single best action for the player right now.

    • attackShoot the nearest enemy.
    • retreatMove away from enemies to gain distance.
    • grab_medkitMove toward the medkit pickup.
    • run_to_exitHead straight for the level exit.
  2. in_danger是/否

    Is the player in immediate danger of dying within the next few seconds?

  3. threat打分

    How threatening is the overall situation for the player?

    • 0trivial
    • 1manageable
    • 2dangerous
    • 3critical

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    action: { type: 'choice', instructions: 'Pick the single best action for the player right now.',
      criteria: { attack: 'Shoot the nearest enemy.', retreat: 'Move away from enemies to gain distance.', grab_medkit: 'Move toward the medkit pickup.', run_to_exit: 'Head straight for the level exit.' } },
    in_danger: { type: 'boolean', instructions: 'Is the player in immediate danger of dying within the next few seconds?' },
    threat: { type: 'score', instructions: 'How threatening is the overall situation for the player?',
      criteria: ['trivial', 'manageable', 'dangerous', 'critical'] },
  },
});

同类的其他项目