tanuki.py
tanuki.py copied to clipboard
Support for enums
Currently validator.check_type does not support enum outputs types. If LLM outputs a valid integer, check_type outputs False where it should put True
class RequestIntent(Enum):
REFUNDS = 1
PRODUCT_QUESTIONS = 2
ACCOUNT_OPENING = 3
ORDER_STATUS = 4
ORDER_MODIFICATIONS = 5
@Monkey.patch
def classify_request(input: str) -> RequestIntent: # Multiclass classification
"""
Classify the incoming user request intent
"""