跳到主要内容

Node.js

当前文档不提供已稳定对齐 v1 运行时的 Node.js SDK。

建议直接用 fetch 包一层:

const response = await fetch(
"http://127.0.0.1:3000/v1/users/dylan/streams/<uuid>/retrieve",
{
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: "What does Dylan prefer?",
limit: 5,
}),
},
);

console.log(await response.json());