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

Supported Types

imageGenerationServerToolConfigUnion := components.CreateImageGenerationServerToolConfigUnionStr(string{/* values here */})

imageGenerationServerToolConfigUnion := components.CreateImageGenerationServerToolConfigUnionNumber(float64{/* values here */})

imageGenerationServerToolConfigUnion := components.CreateImageGenerationServerToolConfigUnionArrayOfAny([]any{/* values here */})

Union Discrimination

Use the Type field to determine which variant is active, then access the corresponding field:
switch imageGenerationServerToolConfigUnion.Type {
	case components.ImageGenerationServerToolConfigUnionTypeStr:
		// imageGenerationServerToolConfigUnion.Str is populated
	case components.ImageGenerationServerToolConfigUnionTypeNumber:
		// imageGenerationServerToolConfigUnion.Number is populated
	case components.ImageGenerationServerToolConfigUnionTypeArrayOfAny:
		// imageGenerationServerToolConfigUnion.ArrayOfAny is populated
}