> ## 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.

# endTurn

> TypeScript SDK 레퍼런스

> **endTurn**(`opts?`): `void`

현재 Turn을 종료합니다. 활성 Turn이 없으면 아무 작업도 수행하지 않습니다.

정의 위치: [src/genai/api.ts:183](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/genai/api.ts#L183)

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

<div id="opts">
  ### opts?
</div>

`SpanEndOptions`

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

`void`

<div id="examples">
  ## 예시
</div>

```ts twoslash theme={null}
// @noErrors
weave.endTurn();
```

```ts twoslash theme={null}
// @noErrors
weave.endTurn({endTime: new Date('2026-05-29T10:00:01.700Z')});
```

```ts twoslash theme={null}
// @noErrors
weave.endTurn({error: new Error('agent loop diverged')});
```
