Embedding - Go SDK

Embedding type definition

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

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

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

Union Discrimination

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

1switch embedding.Type {
2 case operations.EmbeddingTypeArrayOfNumber:
3 // embedding.ArrayOfNumber is populated
4 case operations.EmbeddingTypeStr:
5 // embedding.Str is populated
6}