Skip to main content
The Go SDK and docs are currently in beta. Report issues on GitHub.

Supported Types

OutputImage

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

OutputLogs

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

Union Discrimination

Use the Type field to determine which variant is active, then access the corresponding field:
switch outputCodeInterpreterCallItemOutputUnion.Type {
	case components.OutputCodeInterpreterCallItemOutputUnionTypeImage:
		// outputCodeInterpreterCallItemOutputUnion.OutputImage is populated
	case components.OutputCodeInterpreterCallItemOutputUnionTypeLogs:
		// outputCodeInterpreterCallItemOutputUnion.OutputLogs is populated
	default:
		// Unknown type - use outputCodeInterpreterCallItemOutputUnion.GetUnknownRaw() for raw JSON
}