"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, {
    GEMINI_EMBEDDING_MODEL: function() {
        return GEMINI_EMBEDDING_MODEL;
    },
    GeminiEmbedding: function() {
        return GeminiEmbedding;
    }
});
const _base = require("../llm/gemini/base.js");
const _types = require("../llm/gemini/types.js");
const _types1 = require("./types.js");
var GEMINI_EMBEDDING_MODEL;
(function(GEMINI_EMBEDDING_MODEL) {
    GEMINI_EMBEDDING_MODEL["EMBEDDING_001"] = "embedding-001";
    GEMINI_EMBEDDING_MODEL["TEXT_EMBEDDING_004"] = "text-embedding-004";
})(GEMINI_EMBEDDING_MODEL || (GEMINI_EMBEDDING_MODEL = {}));
class GeminiEmbedding extends _types1.BaseEmbedding {
    model;
    session;
    constructor(init){
        super();
        this.model = init?.model ?? "embedding-001";
        this.session = init?.session ?? _base.GeminiSessionStore.get({
            backend: _types.GEMINI_BACKENDS.GOOGLE
        });
    }
    async getEmbedding(prompt) {
        const client = this.session.getGenerativeModel({
            model: this.model
        });
        const result = await client.embedContent(prompt);
        return result.embedding.values;
    }
    getTextEmbedding(text) {
        return this.getEmbedding(text);
    }
}
