JavaScript建议模型:GLM-5.1
客服机器人
把产品问题整理成简短回复、置信度标签和下一步动作,适合客服或运营工作流。
适合需要稳定回复结构,而不是自由发挥式聊天的场景。
Playground 预设提示词
用户提问:“我们的同步任务延迟了 17 分钟,先排查什么?” 请用 JSON 返回 answer、confidence 和 next_action。
JavaScript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.BATCHIN_API_KEY,
baseURL: "https://api.luminapath.tech/v1",
});
const response = await client.chat.completions.create({
model: "glm-5.1",
messages: [
{
role: "system",
content: "You are a support copilot. Return JSON with answer, confidence, and next_action."
},
{
role: "user",
content: "Our sync job is delayed by 17 minutes. What should we check first?"
}
]
});
console.log(response.choices[0].message.content);