Skip to content
English

ProviderErrorCapture ​

SUPPORT · interface · 类型合同

Captured upstream error body and whether it had to be truncated.

导入 ​

ts
import type { ProviderErrorCapture } from '@jangts/agent-core/support';
js
/** @typedef {import('@jangts/agent-core/support').ProviderErrorCapture} ProviderErrorCapture */

其他公开入口:@jangts/agent-core/types、@jangts/agent-core/structs、@jangts/agent-core/support、@jangts/agent-core/support/model。

定义 ​

ts
interface ProviderErrorCapture

字段结构 ​

字段类型必需说明
bodystring必需见类型定义及调用场景。
truncatedboolean必需见类型定义及调用场景。

类型使用 ​

在调用方读取该合同 ​

ts
import type { ProviderErrorCapture } from '@jangts/agent-core/support';

// 在使用点保留原合同,TS 与 JS 具有相同的运行行为。
function inspect(value: ProviderErrorCapture) {
  return value.body;
}
js
/** @param {import('@jangts/agent-core/support').ProviderErrorCapture} value */
function inspect(value) {
  return value.body;
}

接口参考、使用示例与开发指南。