@yuanchulink/rinne
v0.4.0
Published
Provider-neutral TypeScript runtime for executing agent runs.
Readme
@yuanchulink/rinne
@yuanchulink/rinne 是与模型提供方无关的 TypeScript 运行时 SDK,用于执行 agent run。应用提供模型接口和工具;SDK 管理运行循环、工具分发、状态、事件、取消和结果。
import { createRun } from "@yuanchulink/rinne";
const run = createRun({
input: "Say hello.",
model: {
complete: async () => ({
message: { role: "assistant", content: "Hello!", toolCalls: [] },
finishReason: "stop",
}),
},
});
run.subscribe((event) => console.log(event.type));
const result = await run.start();
if (result.status === "completed") {
console.log(result.response.content);
}工具输入使用 JSON Schema Draft-07 验证。参数始终为 JSON 对象;校验不会强制转换值、插入默认值或移除属性。
