All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bot-storage-mongo.24.9.4.source-code.ioc.kt Maven / Gradle / Ivy

/*
 * Copyright (C) 2017/2021 e-voyageurs technologies
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package ai.tock.bot.mongo

import ai.tock.bot.admin.bot.BotApplicationConfigurationDAO
import ai.tock.bot.admin.bot.observability.BotObservabilityConfigurationDAO
import ai.tock.bot.admin.bot.rag.BotRAGConfigurationDAO
import ai.tock.bot.admin.bot.sentencegeneration.BotSentenceGenerationConfigurationDAO
import ai.tock.bot.admin.bot.vectorstore.BotVectorStoreConfigurationDAO
import ai.tock.bot.admin.dialog.DialogReportDAO
import ai.tock.bot.admin.indicators.IndicatorDAO
import ai.tock.bot.admin.indicators.metric.MetricDAO
import ai.tock.bot.admin.story.StoryDefinitionConfigurationDAO
import ai.tock.bot.admin.test.TestPlanDAO
import ai.tock.bot.admin.user.UserReportDAO
import ai.tock.bot.engine.dialog.DialogFlowDAO
import ai.tock.bot.engine.feature.FeatureDAO
import ai.tock.bot.engine.user.UserLock
import ai.tock.bot.engine.user.UserTimelineDAO
import ai.tock.bot.mongo.ai.tock.bot.mongo.FeatureCache
import ai.tock.shared.TOCK_BOT_DATABASE
import ai.tock.shared.getAsyncDatabase
import ai.tock.shared.getDatabase
import ai.tock.translator.I18nDAO
import com.github.salomonbrys.kodein.*
import com.mongodb.client.MongoDatabase
import indicator.IndicatorMongoDAO
import indicator.metric.MetricMongoDAO
import org.litote.kmongo.getCollection


const val MONGO_DATABASE: String = TOCK_BOT_DATABASE

val botMongoModule = Kodein.Module {
    bind(MONGO_DATABASE) with provider { getDatabase(MONGO_DATABASE) }
    bind(MONGO_DATABASE) with provider {
        getAsyncDatabase(
            MONGO_DATABASE
        )
    }
    bind() with provider { BotApplicationConfigurationMongoDAO }
    bind() with provider { BotRAGConfigurationMongoDAO }
    bind() with provider { BotObservabilityConfigurationMongoDAO }
    bind() with provider { BotVectorStoreConfigurationMongoDAO }
    bind() with provider { BotSentenceGenerationConfigurationMongoDAO }
    bind() with provider { StoryDefinitionConfigurationMongoDAO }
    bind() with provider { I18nMongoDAO }
    bind() with provider { UserTimelineMongoDAO }
    bind() with provider { UserTimelineMongoDAO }
    bind() with provider { UserTimelineMongoDAO }
    bind() with provider { TestPlanMongoDAO }
    bind() with provider { MongoUserLock }
    bind() with singleton { MongoFeatureCache() }
    bind() with singleton { FeatureMongoDAO(instance(), MongoBotConfiguration.database.getCollection()) }
    bind() with provider { DialogFlowMongoDAO }
    bind() with provider { IndicatorMongoDAO }
    bind() with provider { MetricMongoDAO }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy