> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conversation

> Conversation 클래스는 여러 턴을 하나의 대화 ID로 묶습니다.

```python theme={"system"}
class Conversation(BaseModel): ...
```

대화입니다. conversation\_id를 기준으로 턴을 그룹화합니다(span 없음).

`continue_parent_trace`는 이 대화가 생성하는 턴의 트레이스 격리 방식을
제어합니다. 기본값 `False`로 두면 각 턴이 자체 OTel 트레이스를 시작합니다
(독립형 Conversations 탭 뷰에 적합). 에이전트 호출을 포함해야 하는
외부 트레이스(예: fastapi로 계측된 요청)가 애플리케이션에 있으면 `True`로 설정하세요.

`Conversation`은 Pydantic 모델입니다. 생성할 때 아래 필드를 키워드 인수로 지정할 수 있습니다.

`Conversation`은 컨텍스트 관리자이므로 `with` 문에서 사용할 수 있습니다.

<h2 id="fields">
  필드
</h2>

| 필드 | 유형 | 기본값 | 설명 |
| - | - | - | - |
| `conversation_id` | `str` | `''` | |
| `conversation_name` | `str` | `''` | |
| `agent_name` | `str` | `''` | 각 턴이 상속하는 대화 수준 기본값입니다(턴에 자체 값이 있으면 그 값이 우선합니다). system\_instructions는 턴마다 달라지므로 제외됩니다. |
| `model` | `str` | `''` | |
| `agent_id` | `str` | `''` | |
| `agent_description` | `str` | `''` | |
| `agent_version` | `str` | `''` | |
| `include_content` | `bool` | `True` | |
| `continue_parent_trace` | `bool` | `False` | |
| `attributes` | `dict[str, Any]` | `{}` | 이 대화가 내보내는 모든 span에 추가되는 속성입니다. |

<h2 id="methods">
  메서드
</h2>

<h3 id="start_turn">
  start\_turn
</h3>

```python theme={"system"}
def start_turn(
    *,
    user_message: str = '',
    model: str = '',
    agent_name: str = '',
    agent_id: str = '',
    agent_description: str = '',
    agent_version: str = '',
    system_instructions: Union[list[str], None] = None,
) -> Turn: ...
```

턴을 생성하고 시작합니다. 이전 턴이 아직 열려 있으면 자동으로 종료합니다.

`_current_turn` contextvar를 설정하므로, 컨텍스트 관리자 사용 여부와 관계없이
`get_current_turn()`으로 턴에 접근할 수 있습니다.
`agent_name` / `model` / `agent_id` / `agent_description`
/ `agent_version`은 각각 비워 두면 대화의 기본값이
사용되며, `continue_parent_trace`는 상속됩니다. 이 값들은 나중에 `turn.record(...)`로
재정의할 수 있습니다.

`system_instructions`(에이전트의 system 프롬프트)는 턴의
invoke\_agent span에 포함됩니다. `start_llm`과 마찬가지로, 반환된 `Turn`에
속성을 할당하여 나중에 설정할 수도 있습니다.

<h3 id="end">
  end
</h3>

```python theme={"system"}
def end() -> None: ...
```
