import { MistralAISession } from "../llm/mistral.js";
import { BaseEmbedding } from "./types.js";
export var MistralAIEmbeddingModelType;
(function(MistralAIEmbeddingModelType) {
    MistralAIEmbeddingModelType["MISTRAL_EMBED"] = "mistral-embed";
})(MistralAIEmbeddingModelType || (MistralAIEmbeddingModelType = {}));
export class MistralAIEmbedding extends BaseEmbedding {
    model;
    apiKey;
    session;
    constructor(init){
        super();
        this.model = "mistral-embed";
        this.session = new 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);
    }
}
