using System; namespace LLama.Batched; /// /// Base class for exceptions thrown from /// public class ExperimentalBatchedExecutorException : Exception { internal ExperimentalBatchedExecutorException(string message) : base(message) { } } /// /// This exception is thrown when "Prompt()" is called on a which has /// already been prompted and before "Infer()" has been called on the associated /// . /// public class AlreadyPromptedConversationException : ExperimentalBatchedExecutorException { internal AlreadyPromptedConversationException() : base("Must call `Infer()` before prompting this Conversation again") { } } /// /// This exception is thrown when "Sample()" is called on a which has /// already been prompted and before "Infer()" has been called on the associated /// . /// public class CannotSampleRequiresInferenceException : ExperimentalBatchedExecutorException { internal CannotSampleRequiresInferenceException() : base("Must call `Infer()` before sampling from this Conversation") { } } /// /// This exception is thrown when "Sample()" is called on a which was not /// first prompted. /// . /// public class CannotSampleRequiresPromptException : ExperimentalBatchedExecutorException { internal CannotSampleRequiresPromptException() : base("Must call `Prompt()` and then `Infer()` before sampling from this Conversation") { } } /// /// This exception is thrown when is called when = true /// public class CannotModifyWhileRequiresInferenceException : ExperimentalBatchedExecutorException { internal CannotModifyWhileRequiresInferenceException() : base("Cannot `Modify()` a conversation while RequiresInference is true") { } } /// /// This exception is thrown when "Save()" is called on a which has /// already been prompted and before "Infer()" has been called. /// . /// public class CannotSaveWhileRequiresInferenceException : ExperimentalBatchedExecutorException { internal CannotSaveWhileRequiresInferenceException() : base("Must call `Infer()` before saving this Conversation") { } }