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字段结构
| 字段 | 类型 | 必需 | 说明 |
|---|---|---|---|
body | string | 必需 | 见类型定义及调用场景。 |
truncated | boolean | 必需 | 见类型定义及调用场景。 |
类型使用
在调用方读取该合同
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;
}