@aphrody/typesafe-sdk

中文文档
0.6.2发布于 2026/10/14MITTypeScriptESM + CJS零依赖近 30 天下载 2079

TypeScript SDK for the TypeSafe API

原始使用文档

TypeSafe AI JavaScript SDK

JavaScript and TypeScript SDK for TypeSafe AI.

Quickstart

Install the SDK (Node.js 20 or newer):

npm install @typesafe-ai/sdk

Set TYPESAFE_API_KEY in your environment, then create and use the client:

import { choice, TypeSafeClient } from "@typesafe-ai/sdk";

const client = new TypeSafeClient();
const response = await client.systemOne({
  state: { document: "I was charged twice. Please fix this ASAP." },
  questions: {
    category: choice("What is this ticket about?", {
      billing: null,
      technical: null,
      other: null,
    }),
  },
});

console.log(response.answers.category.choice);

Answer types are inferred from your questions. The package includes ESM, CommonJS, and TypeScript declarations.

Documentation

Learn what TypeSafe can do in the TypeSafe docs. See the SDK's client and types for API options and defaults.

版本与发布记录

@aphrody/typesafe-sdk 共发布 3 个版本,首次发布于 2026/10/14;过去 12 个月发布了 3 个版本。

版本发布日期距今
0.6.2latest2026/10/1425 天前
0.6.12026/10/1425 天前
0.0.0-stage2026/10/1425 天前

关于 @aphrody/typesafe-sdk 的常见问题

@aphrody/typesafe-sdk 是什么?

TypeScript SDK for the TypeSafe API

如何安装 @aphrody/typesafe-sdk?

在项目目录运行 npm install @aphrody/typesafe-sdk,或使用 pnpm add / yarn add / bun add。

@aphrody/typesafe-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aphrody/typesafe-sdk 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@aphrody/typesafe-sdk 可以商用吗?

@aphrody/typesafe-sdk 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aphrody/typesafe-sdk 的下载量有多少?

根据 npm 官方下载统计,@aphrody/typesafe-sdk 在 2026/10/06 – 2026/11/04 这 30 天内被下载 2,079 次,日均约 69 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aphrody/typesafe-sdk 还在维护吗?

最新版本 0.6.2 发布于 2026/10/14(25 天前);至今共发布 3 个版本,其中过去 12 个月发布了 3 个;首次发布于 2026/10/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。