Skip to content

rigging.error

We try to avoid creating custom exceptions unless they are necessary.

We use the built-in and pydantic exceptions as much as possible.

CompletionExhaustedMaxRoundsError(max_rounds: int, completion: str) #

Bases: ExhaustedMaxRoundsError

Raised when the maximum number of rounds is exceeded while generating completions.

Source code in rigging/error.py
def __init__(self, max_rounds: int, completion: str):
    super().__init__(max_rounds)
    self.completion = completion
    """The completion which was being generated when the exception occured."""

completion = completion instance-attribute #

The completion which was being generated when the exception occured.

ExhaustedMaxRoundsError(max_rounds: int) #

Bases: Exception

Raised when the maximum number of rounds is exceeded while generating.

Source code in rigging/error.py
def __init__(self, max_rounds: int):
    super().__init__(f"Exhausted max rounds ({max_rounds}) while generating")
    self.max_rounds = max_rounds
    """The number of rounds which was exceeded."""

max_rounds = max_rounds instance-attribute #

The number of rounds which was exceeded.

InvalidModelSpecifiedError(model: str) #

Bases: Exception

Raised when an invalid identifier is specified when getting a generator.

Source code in rigging/error.py
def __init__(self, model: str):
    super().__init__(f"Invalid model specified: {model}")

MessagesExhaustedMaxRoundsError(max_rounds: int, messages: list[Message]) #

Bases: ExhaustedMaxRoundsError

Raised when the maximum number of rounds is exceeded while generating messages.

Source code in rigging/error.py
def __init__(self, max_rounds: int, messages: list["Message"]):
    super().__init__(max_rounds)
    self.messages = messages
    """The messages which were being generated when the exception occured."""

messages = messages instance-attribute #

The messages which were being generated when the exception occured.

MissingModelError(content: str) #

Bases: Exception

Raised when a model is missing when parsing a message.

Source code in rigging/error.py
def __init__(self, content: str):
    super().__init__(content)