Refactor InspirationPlugin in examples/inspiration_plugin.py

This commit is contained in:
2024-11-06 07:54:42 -05:00
parent 48e6ef2a43
commit 3e1d1f98ad
+1 -4
View File
@@ -14,9 +14,6 @@ class InspirationPlugin(sm.BasePlugin):
"The universe is in constant dialogue with those who listen.",
]
def __init__(self):
super().__init__() # Make sure to call parent class's __init__
def get_inspiration(self):
# Randomly select an inspirational quote or prompt
return random.choice(self.inspirations)
@@ -34,4 +31,4 @@ conversation.add_plugin(InspirationPlugin())
# Add a user message and send the conversation
conversation.add_message(role="user", text="Tell me something inspiring.")
response = conversation.send()
print(response)
print(response.text)