Skip to content

Bot API SDK #236

Description

@lyzz0612

是否考虑封装提供一个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);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions