跳到正文
DEV Community · LLM· Sandscale·· 6 天前AI 评分67

如何为 LLM 设计 run_code 工具:输入 Schema、限制与可操作的执行结果

Designing a run_code tool for an LLM: schema, limits and results a model can act on

AI 导读

Sandscale 逐字段讲解了面向 LLM 的 run_code 工具设计,并给出基于 @sandscale/sdk 1.0.0 的 TypeScript 处理器。方案使用每次新建的无网络沙箱,支持 Python 和 JavaScript,将超时限制在 1 至 120 秒,并通过状态、截断标记和重试标志帮助模型处理执行结果。

来源:DEV Community · LLM · dev.to