from transformers import AutoTokenizer from transformers import Tool class SentenceCounterTool(Tool): name = "sentence_counter" description = "This is a tool for counting sentences of an input." inputs = ["text"] outputs = ["text"] def __call__(self, prompt: str): sentences = str.split(". ") return len(sentences)