@mottyjs /决定
Motty SDK的插件。决策模型回答关于文本的输入问题
概率,其中必须要求聊天模型进行散文和解析。 decision(name)
说出一个,和 choice, score 和 noul 是被问到的问题。
bun add @mottyjs/decision
import { choice, decision, noul, score } from "@mottyjs/decision";
判断一个线程的打开是否在主题上,并允许请求通过 决策模型down:
import { decision, noul } from "@mottyjs/decision";
const jev = decision("typesafe/jev-latest");
export async function isOnTopic(opening: string, onTopicProbability: number): Promise<boolean> {
try {
const { software } = await jev.decide(opening, {
software: noul({ instructions: "Is this a request about software or a codebase?" }),
});
return software.noul >= onTopicProbability;
} catch {
return true;
}
}
SDK作为一个整体在 根的自述,以及其设计背后的原因 ARCHITECTURE.md.