Aily Code SDK JavaScript
Usage
调用 Action
const { callAction } = require('@apaas-ai/code-sdk-core');
const apiName = "brn:cn:spring:all:all:connector_action:spring_llm_v2/1.0.0/spring_llm_v2";
const res = await callAction(apiName, {
query: "你好",
llmSettingID: "some-llm-id",
});
生成消息内容
const { message } = require('@apaas-ai/code-sdk-core');
const { Button, ColorText } = message.components;
const builder = new message.Builder();
builder.addLine(
new ColorText({
children: "Hello World",
color: "green",
})
);
builder.addLine(
new Button({
children: "Click Me",
})
);
const message = builder.toMessage();
Development
- 根目录下创建
.env
文件,内容如下,设置 BOE 环境中测试用的 clientId 和 clientSecret:
VITE_LOCAL_DEBUG=true
VITE_CLIENT_ID=c_xxxxxxx
VITE_CLIENT_SECRET=cxxxx
VITE_DOMAIN=https://ae-openapi.feishu-boe.cn/
- 执行
pnpm test
通过单元测试进行开发调试。