OutputCodeInterpreterCallItemOutputUnion - Go SDK

OutputCodeInterpreterCallItemOutputUnion type definition

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

Supported Types

OutputImage

1outputCodeInterpreterCallItemOutputUnion := components.CreateOutputCodeInterpreterCallItemOutputUnionImage(components.OutputImage{/* values here */})

OutputLogs

1outputCodeInterpreterCallItemOutputUnion := components.CreateOutputCodeInterpreterCallItemOutputUnionLogs(components.OutputLogs{/* values here */})

Union Discrimination

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

1switch outputCodeInterpreterCallItemOutputUnion.Type {
2 case components.OutputCodeInterpreterCallItemOutputUnionTypeImage:
3 // outputCodeInterpreterCallItemOutputUnion.OutputImage is populated
4 case components.OutputCodeInterpreterCallItemOutputUnionTypeLogs:
5 // outputCodeInterpreterCallItemOutputUnion.OutputLogs is populated
6 default:
7 // Unknown type - use outputCodeInterpreterCallItemOutputUnion.GetUnknownRaw() for raw JSON
8}