Skip to main content
The Go SDK and docs are currently in beta. Report issues on GitHub.
Embedding vector as an array of floats or a base64 string

Supported Types

embedding := operations.CreateEmbeddingArrayOfNumber([]float64{/* values here */})

embedding := operations.CreateEmbeddingStr(string{/* values here */})

Union Discrimination

Use the Type field to determine which variant is active, then access the corresponding field:
switch embedding.Type {
	case operations.EmbeddingTypeArrayOfNumber:
		// embedding.ArrayOfNumber is populated
	case operations.EmbeddingTypeStr:
		// embedding.Str is populated
}