> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-3071-org-scoped-api-keys.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# withAttributes

> TypeScript SDK 레퍼런스

> **withAttributes**\<`T`>(`attrs`, `fn`): `T` | `Promise`\<`T`>

현재 실행 컨텍스트에 속성을 추가하여 `fn` 내부에서 생성된 모든 calls가
자동으로 이를 상속하도록 합니다. 속성은 트레이스 서버의 call 기록에
기록되며 Weave UI/필터링에 표시되므로 request ID, tenant, 실험 등으로 run에 태그를 지정하는 데
적합합니다.

예시:

```ts twoslash theme={null}
// @noErrors
await withAttributes({requestId: 'abc'}, async () => {
  await myOp();
});
```

정의 위치: [src/clientApi.ts:209](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/clientApi.ts#L209)

<div id="type-parameters">
  ## 유형 매개변수
</div>

<div id="t">
  ### T
</div>

`T`

<div id="parameters">
  ## 매개변수
</div>

<div id="attrs">
  ### attrs
</div>

`Record`\<`string`, `any`>

<div id="fn">
  ### fn
</div>

() => `T` | `Promise`\<`T`>

<div id="returns">
  ## 반환값
</div>

`T` | `Promise`\<`T`>
