InputsPhaseUnion - Go SDK

InputsPhaseUnion type definition

The Go SDK and docs are currently in beta. Report issues on GitHub.

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

InputsPhaseCommentary

1inputsPhaseUnion := components.CreateInputsPhaseUnionInputsPhaseCommentary(components.InputsPhaseCommentary{/* values here */})

InputsPhaseFinalAnswer

1inputsPhaseUnion := components.CreateInputsPhaseUnionInputsPhaseFinalAnswer(components.InputsPhaseFinalAnswer{/* values here */})

1inputsPhaseUnion := components.CreateInputsPhaseUnionAny(any{/* values here */})

Union Discrimination

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

1switch inputsPhaseUnion.Type {
2 case components.InputsPhaseUnionTypeInputsPhaseCommentary:
3 // inputsPhaseUnion.InputsPhaseCommentary is populated
4 case components.InputsPhaseUnionTypeInputsPhaseFinalAnswer:
5 // inputsPhaseUnion.InputsPhaseFinalAnswer is populated
6 case components.InputsPhaseUnionTypeAny:
7 // inputsPhaseUnion.Any is populated
8}