Help: I'm trying to use an Extractor as so:
class SentimentExtractor(BaseExtractor):
def __init__(self, me, str):
print("here")
self.me = me
self.str = str
async def aextract(self, nodes: Sequence) -> List[Dict]:
metadata_list = []
for node in nodes:
generated_sentiment = {"sentiment": "Positive"} # Replace with actual LLM call
metadata_list.append(generated_sentiment)
return metadata_list
when I instanciate the class
sentiment_extractor = SentimentExtractor(me = "zsdfsadf", str="hello")
I get errors:
ValueError: "SentimentExtractor" object has no field "me"
If I define my own BaseExtractor just as a replacement, I don't get the error
I'm trying to actually pass in an LLM and custom prompt to extract the sentiment out of nodes and add to the metadata but seem to be running into something odd. Anything with dependencies?