正在自动登录…
osolmaz/ switch
switch 是一个用于构建决策模型(如 Jev)的框架,通过将任务状态转化为类型化问题,让模型逐步选择下一步,适用于评估、棋类游戏等场景。
AI 中文解读 · 根据仓库描述与 README 生成 · 2026/10/31 05:27:16 · 查看原文
- 累计 Stars
- 319
- 当前热度
- 1~7 天 · 小火
- 仓库创建时间
选用指南
AI 根据 README 整理 · 2026/10/31 05:27:16
- 适用场景
适用于需要决策模型逐步选择有限步骤的任务,如评估文档、下棋、维基竞速。
查看 README 依据
text of the PDF, Word and Markdown files and puts all of it into the context. When the visual formatting of the output is a criterion, every page has to go in as an image too. With 200 pages and a question that needs only a few of them, most of that context is wasted. With switch, the decision model navigates the documents and takes in only what it needs. The [rubric judge](examples/rubric-judge/README.md) works this way. It reads parts of files, looks at page images and searches for terms, one step at a time, until it can grade each rubric item.
- [Rubric judge](examples/rubric-judge/README.md) grades a saved answer to a task against the task's rubric. - [Chess](examples/chess/README.md) plays chess against random moves, Stockfish, or itself. - [WikiRace](examples/wikirace/README.md) races from one Wikipedia article to another by following links. ## Write a domain A domain gives `initial`, `questions` and `transition`, and optionally `view`. This one routes a support ticket. The model reads logs one at a time until it picks stop, and then a last step asks which team gets the ticket. ```ts import { type Choice,
- 使用方式
通过 npm 安装,以库的形式导入使用,提供 run 和 replay 命令。
查看 README 依据
A run also ends when a request fails, or at a step limit that a domain may set as a safety net. [docs/MATH.md](docs/MATH.md) writes the loop down in symbols. ## Install switch needs Node.js 22.18 or newer. Add it to a project from npm: ```bash npm install @osolmaz/switch ``` | Import | What it gives | | ------------------------- | -------------------------------------------------------------------- | | `@osolmaz/switch` | The loop, the domain types, the pick helper, traces and replay |
| `@osolmaz/switch/models` | `piAiDecider`, which asks a classifier model that pi-ai lists | | `@osolmaz/switch/cli` | `commandLine`, which gives a harness the `run` and `replay` commands | | `@osolmaz/switch/testing` | A fake decider for tests that make no model calls | The examples and the [viewer](viewer/README.md) live in this repository and are not on npm. To run them, clone it and install its workspace with [pnpm](https://pnpm.io): ```bash git clone https://github.com/osolmaz/switch.git cd switch pnpm install ``` ## Examples
- 部署要求
需要 Node.js 22.18 或更高版本。
查看 README 依据
A run also ends when a request fails, or at a step limit that a domain may set as a safety net. [docs/MATH.md](docs/MATH.md) writes the loop down in symbols. ## Install switch needs Node.js 22.18 or newer. Add it to a project from npm: ```bash npm install @osolmaz/switch ``` | Import | What it gives | | ------------------------- | -------------------------------------------------------------------- | | `@osolmaz/switch` | The loop, the domain types, the pick helper, traces and replay |
README
正在加载 README…
收录信息
- 仓库创建时间
- 2026/10/25 22:12:42
- 首次达标收录
- 2026/10/31 05:21:32
- 统计更新时间
- 2026/10/31 09:30:57
按创建时长与累计 Stars 判断等级。首次达标收录后,即使未达当前门槛仍保留;累计 Stars 和仓库状态会定期更新。确认只有 README 及辅助文件的仓库会停止公开。
模型评估
值得看加权总分 3.9 / 5
由 Jev 模型根据仓库描述与 README 评估,2026/10/31 05:21:32 生成。评分仅供参考,不是代码、安全或许可证审查;热度等级另按创建时长与累计 Stars 计算。
仓库信息
- 最近推送
- 2026/10/30 13:12:52
- 许可证标识
- MIT
- Fork 数
- 23
- 当前状态
- 未归档
收录记录
按创建时长与累计 Stars 首次收录:小火
首次发现项目