> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter-d02e98a0-mintlify-a46887cf.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OutputMessageItemPhaseUnion - Go SDK

> OutputMessageItemPhaseUnion type definition

<Warning>
  The Go SDK and docs are currently in beta.
  Report issues on [GitHub](https://github.com/OpenRouterTeam/go-sdk/issues).
</Warning>

The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages.

## Supported Types

### OutputMessageItemPhaseCommentary

```go lines theme={null}
outputMessageItemPhaseUnion := components.CreateOutputMessageItemPhaseUnionOutputMessageItemPhaseCommentary(components.OutputMessageItemPhaseCommentary{/* values here */})
```

### OutputMessageItemPhaseFinalAnswer

```go lines theme={null}
outputMessageItemPhaseUnion := components.CreateOutputMessageItemPhaseUnionOutputMessageItemPhaseFinalAnswer(components.OutputMessageItemPhaseFinalAnswer{/* values here */})
```

###

```go lines theme={null}
outputMessageItemPhaseUnion := components.CreateOutputMessageItemPhaseUnionAny(any{/* values here */})
```

## Union Discrimination

Use the `Type` field to determine which variant is active, then access the corresponding field:

```go lines theme={null}
switch outputMessageItemPhaseUnion.Type {
	case components.OutputMessageItemPhaseUnionTypeOutputMessageItemPhaseCommentary:
		// outputMessageItemPhaseUnion.OutputMessageItemPhaseCommentary is populated
	case components.OutputMessageItemPhaseUnionTypeOutputMessageItemPhaseFinalAnswer:
		// outputMessageItemPhaseUnion.OutputMessageItemPhaseFinalAnswer is populated
	case components.OutputMessageItemPhaseUnionTypeAny:
		// outputMessageItemPhaseUnion.Any is populated
}
```
