Skip to content

KorraAIModel class

toncho11 edited this page Jul 1, 2019 · 5 revisions
public interface IKorraAIModel
    {
        string Name { get; }

        string Version { get; }

        void Init();

        event EventHandler ContextLoaded;

        KorraAISampler GetSampler();

        ModelContext GetContext();

        IDistributions GetCognitiveDist();

        /// <summary>
        /// Allows to change behavior based on: the time that has passed or if a pure or uncertain fact has been updated (by for example user's response)
        /// </summary>
        /// <param name="timeSinceStart"></param>
        /// <param name="pureFactUpdated"></param>
        /// <param name="uncertainFactUpdated"></param>
        /// <returns></returns>
        bool ModelUpdate(TimeSpan timeSinceStart, bool pureFactUpdated, bool uncertainFactUpdated);

        /// <summary>
        /// It gives you access to all upcoming interactions
        /// Here you can insert a new interaction or modify an existing one
        /// </summary>
        /// <param name="interactions"></param>
        bool InteractionsUpdate(TimeSpan timeSinceStart, int interactionsDoneSinceStart, ref Queue<CommItem> interactions);

        /// <summary>
        /// Here you can modify the response to the user (for special cases)
        /// </summary>
        /// <param name="fact"></param>
        void BeforeAnalyseUserResponse(PureFact fact);

        /// <summary>
        /// Inspect the next interaction
        /// </summary>
        /// <param name="nextInteraction"></param>
        void InspectNextInteraction(CommItem nextInteraction);

        /// <summary>
        /// Describes how distributions change while performing sampling and a certain category is depleted from items
        /// </summary>
        /// <returns></returns>
        bool AdjustProbVariablesDuringPlanning();
    }

The methods of the interface are called to control the bot. For example GetCognitiveDist() supplies the distributions that will be used to control things like how often the bot smiles, the different time-outs, etc. And methods like InspectNextInteraction() act like hooks, they allow you to modify or to add code logic before or after an interaction.

Clone this wiki locally