01
Node.js 后端
在 Express 或 Next.js 路由处理器中通过 Fetch 和 TypeScript 调用 Compress。
查看 Compress 和 Generate 端点的可运行服务端 HTTP 示例,以及 RAG 和代理集成模式。
在 Express 或 Next.js 路由处理器中通过 Fetch 和 TypeScript 调用 Compress。
使用 HTTPX 的异步请求、超时和错误管理的基本示例。
根据查询优化检索器输出并将其传递给模型调用的管道。
在下一个代理步骤之前缩小工具结果和任务历史的流程。
const response = await fetch("https://api.aether.tr/v1/compress", {
method: "POST",
headers: {
"Authorization": "Bearer <API_KEY>",
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json"
},
body: JSON.stringify({ context, query, level: "auto" })
});
const payload = await response.json();
if (!response.ok) throw new Error(payload.error?.code ?? "AETHER_API_ERROR");
const optimizedContext = payload.data.compressed;联系团队,将Aether Compress添加到您现有的LLM流程中。