base_tokenizer
BaseTokenizer
Bases: ABC
BaseTokenizer
Bases: ABC
griptape/tokenizers/base_tokenizer.py
DEFAULT_MAX_INPUT_TOKENS = 4096
class-attribute
instance-attribute
DEFAULT_MAX_OUTPUT_TOKENS = 1000
class-attribute
instance-attribute
MODEL_PREFIXES_TO_MAX_INPUT_TOKENS = {}
class-attribute
instance-attribute
MODEL_PREFIXES_TO_MAX_OUTPUT_TOKENS = {}
class-attribute
instance-attribute
max_input_tokens: int = field(kw_only=True, default=None)
class-attribute
instance-attribute
max_output_tokens: int = field(kw_only=True, default=None)
class-attribute
instance-attribute
model: str = field(kw_only=True)
class-attribute
instance-attribute
stop_sequences: list[str] = field(default=Factory(list), kw_only=True)
class-attribute
instance-attribute
__attrs_post_init__()
griptape/tokenizers/base_tokenizer.py
count_input_tokens_left(text)
count_output_tokens_left(text)