API 参考
以下每个页面都由 SDK 源码自动生成,与 @xiangxinai/sdk 0.1.0 的导出一一对应。所有符号都从包的根入口导出:
ts
import { XiangxinClient, choice, noul, score, APIError } from '@xiangxinai/sdk'
import type { SystemOneResult, RetryPolicy } from '@xiangxinai/sdk'- 从
XiangxinClient开始:它的systemOne()返回APIPromise,结果类型是SystemOneResult。 - 问题用
noul()、choice()、score()创建。 - 所有错误都继承自
XiangxinError,服务端错误继承自APIError。 - 安装、配置与用法示例见 JavaScript SDK。
类
- APIConnectionError
- APIError
- APIPromise
- APIResponseValidationError
- APITimeoutError
- APIUserAbortError
- AuthenticationError
- BadRequestError
- InsufficientBalanceError
- InternalServerError
- NotFoundError
- OverloadedError
- PermissionDeniedError
- RateLimitError
- UnprocessableEntityError
- XiangxinClient
- XiangxinError
接口
- ChoiceAnswer
- ChoiceQuestion
- Logger
- ModelCard
- Models
- NoulAnswer
- NoulCriteria
- NoulQuestion
- Questions
- RequestOptions
- RetryPolicy
- ScoreAnswer
- ScoreQuestion
- SystemOneRequest
- SystemOneRequestPayload
- SystemOneResult
- Usage
- WithResponse
- XiangxinClientConfig
类型别名
- Answer
- ChoiceCriteria
- Description
- EntryType
- EnvVar
- Fetch
- JsonObject
- JsonValue
- LogLevel
- Question
- ResultFor
- ScoreCriteria
- ScoreLegend
- ScoreOf
- State
变量
- DEFAULT_BASE_URL
- DEFAULT_MODEL
- DEFAULT_RETRY_POLICY
- DEFAULT_TIMEOUT_MS
- ENV
- LOG_LEVELS
- MODEL_MS_HEADER
- REQUEST_ID_HEADER
- TOTAL_MS_HEADER
- VERSION

