Newshot

Nyno 10 开源发布:降低 AI 风险,将代码与配置分离

Translation(model translation, not the source's own text)

仓库文件导航

题图
题图

Nyno 10

通过将代码与配置分离来降低 AI 创新风险。

Nyno 是一个全球开放协议,用于降低 AI 创新的风险。

使用 Nyno 之前:


        python3 big-python-script-or-project.py
# 1000+ lines
# of code
# + custom output shape
      

使用 Nyno 之后:


        nyno10 your-workflow.yml
# 3 specific YAML workflow steps
# + clean output shape
      

清晰的输出结构

每个 Nyno 工作流都会以统一的 JSON 结构生成清晰的输入/输出日志:


        {
     "status": "ok",
     "execution": [
         { step },
         { step }
         { step }
     ]
}
      

每个步骤都完全可观测:


        {
    input: {
        args: ["Hi"],
        context: {
            mistral_api_key: "your api key"
            set: "prev"
        }
    },
    output: {
        r: 0,
        c: {
            last_step: "ai-mistral-text",
            prev: "Hello, how can I help?",
            prev_meta: {
                  usage: {}
             }
        }
    }
}
      

像 "prev" 和 "meta" 这样的常规键用于设置上一步的文本值或设置详细的元信息。要使用自定义变量名,请更改 "set" 键的值。


        {
  "prev": "Hello, how can I help?",
  "prev_meta": {
    "usage": {}
  }
}
      

决定下一个节点

r 值(通常为 0)决定下一个节点。当它为 0 时,会直接进入第一个后续步骤。在更复杂的工作流中,我们可以跳转到多个后续节点:


        workflow:
   - id: 1
     step: if
     args:
       - 1
       - is
       - 1
     next: [2,3]
   - id: 2
     step: echo
     args:
       - Reached node 2
   - id: 3
     step: echo
     args:
       - Reached Node 3
      

安装与使用

运行服务器


        git clone https://github.com/flowagi-eu/nyno
cd nyno && bash run-container-prod.sh podman # or docker
      

运行你的第一个工作流

创建你的第一个 workflow.yml:


        workflow:
  - step: ai-mistral-text
    args:
      - hi
    context:
      mistral_api_key: "your-mistral-api-key"
      

使用 NodeJS CLI 运行它:


        node nyno/cli/cli.js workflow.yml
      

可选:添加 nyno10 别名:


        alias nyno10='node $HOME/nyno/cli/cli.js'
      

这样以后你就可以使用:


        nyno10 workflow.yml
      

扩展

Nyno 可以通过 Python、JavaScript 和 Rust/WASM(WASI P2)扩展进行扩展,因此你可以添加自己的步骤。

你可以将自定义扩展放在 ./my-extensions 文件夹中。

另请参阅 ./my-extensions/README.md

需要更多帮助?

🌐 社区

我们也在 Reddit 上!欢迎加入 r/Nyno。

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by HN AI
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗