UNPKG

ravendb

Version:
26 lines 1.12 kB
import { throwError } from "../../../../Exceptions/index.js"; export class VectorEmbeddingTextField { fieldName; sourceQuantizationType = "Text"; destinationQuantizationType = "Single"; isBase64Encoded = false; embeddingsGenerationTaskIdentifier = ""; constructor(fieldName) { this.fieldName = fieldName; } targetQuantization(targetEmbeddingQuantization) { if (targetEmbeddingQuantization === "Text") { throwError("InvalidOperationException", "Cannot quantize the embedding to Text. This option is only available for sourceQuantizationType."); } this.destinationQuantizationType = targetEmbeddingQuantization; return this; } usingTask(embeddingsGenerationTaskIdentifier) { if (this.sourceQuantizationType !== "Text") { throwError("InvalidOperationException", "The usingTask method can only be used with text embeddings (withText)"); } this.embeddingsGenerationTaskIdentifier = embeddingsGenerationTaskIdentifier; return this; } } //# sourceMappingURL=VectorEmbeddingTextField.js.map