email-env / agent.py
Harshkrjha's picture
Upload folder using huggingface_hub
a45f3fc verified
raw
history blame contribute delete
318 Bytes
from transformers import pipeline
classifier = pipeline("text-classification")
def llm_agent(observation):
result = classifier(observation)[0]['label'].lower()
if "spam" in result:
return "spam"
elif "important" in result:
return "important"
else:
return "normal"