exceptions.py
Module containing custom exceptions.
MismatchedTokenError (Exception)
¤
Raised when the number of input tokens does not match the user config.
Attributes:
| Name | Type | Description |
|---|---|---|
expected |
int |
number of input tokens in the user config. |
given |
int |
number of input tokens passed in. |
__init__(self, expected, given)
special
¤
Initialise the exception.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expected |
int |
number of input tokens in the user config. |
required |
given |
int |
number of input tokens passed in. |
required |
Source code in tembo/exceptions.py
def __init__(self, expected: int, given: int) -> None:
"""
Initialise the exception.
Args:
expected (int): number of input tokens in the user config.
given (int): number of input tokens passed in.
"""
self.expected = expected
self.given = given
super().__init__()