ravendb
Version:
RavenDB client for Node.js
30 lines • 1.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.VectorEmbeddingTextField = void 0;
const index_js_1 = require("../../../../Exceptions/index.js");
class VectorEmbeddingTextField {
fieldName;
sourceQuantizationType = "Text";
destinationQuantizationType = "Single";
isBase64Encoded = false;
embeddingsGenerationTaskIdentifier = "";
constructor(fieldName) {
this.fieldName = fieldName;
}
targetQuantization(targetEmbeddingQuantization) {
if (targetEmbeddingQuantization === "Text") {
(0, index_js_1.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") {
(0, index_js_1.throwError)("InvalidOperationException", "The usingTask method can only be used with text embeddings (withText)");
}
this.embeddingsGenerationTaskIdentifier = embeddingsGenerationTaskIdentifier;
return this;
}
}
exports.VectorEmbeddingTextField = VectorEmbeddingTextField;
//# sourceMappingURL=VectorEmbeddingTextField.js.map