mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-30 09:28:51 +00:00
17 lines
498 B
Python
17 lines
498 B
Python
|
from lollms.console import Conversation
|
||
|
|
||
|
class MyConversation(Conversation):
|
||
|
def __init__(self, cfg=None):
|
||
|
super().__init__(cfg, show_welcome_message=False)
|
||
|
|
||
|
def start_conversation(self):
|
||
|
prompt = "Once apon a time"
|
||
|
def callback(text, type=None):
|
||
|
print(text, end="", flush=True)
|
||
|
return True
|
||
|
print(prompt, end="", flush=True)
|
||
|
output = self.safe_generate(prompt, callback=callback)
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
cv = MyConversation()
|
||
|
cv.start_conversation()
|