是否考虑封装提供一个bot的sdk,对外友好的暴露接受消息回调、发送消息接口之类的,内部自己处理好oauth。组织内已有的sdk仓库好像不是bot的,内置的各种app仓库也很多重复代码,其实应该提取成sdk的。
cursor出了sdk模式,打算写个bot接入进来在微信里让cursor干活的,发现自己得从头实现各种回调,感觉后面很容易和官方不兼容
import { Agent } from "@cursor/sdk";
const agent = await Agent.create({
apiKey: process.env.CURSOR_API_KEY!,
model: { id: "composer-2" },
local: { cwd: process.cwd() },
});
const run = await agent.send("Summarize what this repository does");
for await (const event of run.stream()) {
console.log(event);
}
是否考虑封装提供一个bot的sdk,对外友好的暴露接受消息回调、发送消息接口之类的,内部自己处理好oauth。组织内已有的sdk仓库好像不是bot的,内置的各种app仓库也很多重复代码,其实应该提取成sdk的。
cursor出了sdk模式,打算写个bot接入进来在微信里让cursor干活的,发现自己得从头实现各种回调,感觉后面很容易和官方不兼容