"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    MistralAIEmbedding: function() {
        return MistralAIEmbedding;
    },
    MistralAIEmbeddingModelType: function() {
        return MistralAIEmbeddingModelType;
    }
});
const _mistral = require("../llm/mistral.js");
const _types = require("./types.js");
var MistralAIEmbeddingModelType;
(function(MistralAIEmbeddingModelType) {
    MistralAIEmbeddingModelType["MISTRAL_EMBED"] = "mistral-embed";
})(MistralAIEmbeddingModelType || (MistralAIEmbeddingModelType = {}));
class MistralAIEmbedding extends _types.BaseEmbedding {
    model;
    apiKey;
    session;
    constructor(init){
        super();
        this.model = "mistral-embed";
        this.session = new _mistral.MistralAISession(init);
    }
    async getMistralAIEmbedding(input) {
        const client = await this.session.getClient();
        const { data } = await client.embeddings({
            model: this.model,
            input: [
                input
            ]
        });
        return data[0].embedding;
    }
    async getTextEmbedding(text) {
        return this.getMistralAIEmbedding(text);
    }
}
