メインコンテンツへスキップ

Documentation Index

Fetch the complete documentation index at: https://wb-21fd5541-john-wbdocs-2044-rename-serverless-products.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

withAttributes

withAttributes<T>(attrs, fn): Promise<T> | T 現在の実行コンテキストに属性を追加すると、fn 内で作成されるすべての calls が 自動的にその属性を継承します。属性は trace サーバー上の call レコードに書き込まれ、 Weave UI での表示やフィルタリングに反映されるため、request ID、テナント、実験などで runs にタグ付けするのに適しています。 例:
await withAttributes({requestId: 'abc'}, async () => {
  await myOp();
});

タイプパラメーター

T

パラメーター

タイプ
attrsRecord<string, any>
fn() => TPromise<T>

戻り値

Promise<T> | T

定義元

clientApi.ts:193