跳转到正文
文档导航: 决策模型 / 版本

版本

RightNow AI决策模型版本 更新于

本页内容

用别名跟随当前模型,或用固定的 ID 选择一个版本。

decide.ts
import { RightNowClient } from '@rightnowai/rightnow';

const client = new RightNowClient({
  apiKey: process.env.RIGHTNOW_API_KEY,
  baseURL: "https://api.rightnowai.co/v1",
});
const reply = await client.decide({
  "model": "rightnow-decision-3.0.0",
  "state": "The blender I ordered arrived with a cracked jar.",
  "questions": {
    "damaged": {
      "type": "boolean",
      "instructions": "Did the item arrive damaged?"
    }
  }
});
console.log(JSON.stringify(reply, null, 2));

// Set RIGHTNOW_API_KEY to your API key before running this example.
// Run this example on your server.
// SDK defaults: The default is 5 retries, also the maximum, with 150 seconds
// per attempt and a 60-second total retry budget. A single wait longer than 60
// seconds raises the last error.
// Use Retry-After-Ms, or Retry-After when milliseconds are absent. The wait is
// never shorter than a random backoff floor: a random fraction of 0.5 seconds
// doubled for each attempt, capped at 8 seconds.

以 rnsk_ 开头的密钥通过普通 HTTP 调用决策路径。

SDK 包的版本是 0.5.1。包版本和模型 ID 是两回事。

别名

rightnow-decision 跟随经过验证的别名目标。在模型列表中读取 alias_for 可以看到这个目标。 列表用一个较早的 ID 来称呼同一个模型。请求接受这两个 ID 中的任意一个。

固定的版本

固定的 ID 指向一个经过验证的模型的特定版本。 rightnow-decision 用 rightnow-decision-3.0.0 作答,这是唯一提供的版本,也可以固定。

使用经过身份验证的 GET /v1/models 来查看可用的名称。模型参考中包含这个查询请求。

置信度

新的回答包含 decision、confidence、alternatives 和 calibrated。confidence 是所选结果的概率,在这个版本中 calibrated 为 false。旧的幂等重放保留其存储的回答结构;不要把这里的置信度含义用在它们身上。

下线

固定的模型 ID 可能会下线。之后它会返回 404 model_not_found,所以请使用别名或模型列表中的版本。在更改应用固定的版本之前,请先评估替代模型。