游戏与仿真
一个基于TypeSafe和Jev的agent,通过结构化模拟器状态玩超级马里奥兄弟游戏。
A TypeSafe/Jev agent that plays Super Mario Bros. from structured emulator state.
from typesafe_sdk import Choice, Noul, Score, TypeSafeClientsrc/typesafe_mario/policy.py:29
链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
取自 src/typesafe_mario/policy.py:55
next_action是/否question
danger打分How dangerous is Mario's immediate situation?
0 — Safe open movement1 — Potential obstacle or enemy soon2 — Immediate collision, fall, or enemy threatimport { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
next_action: { type: 'boolean', instructions: 'question' },
danger: { type: 'score', instructions: 'How dangerous is Mario\'s immediate situation?',
criteria: ['Safe open movement', 'Potential obstacle or enemy soon', 'Immediate collision, fall, or enemy threat'] },
},
});