From 19e32aa504633939178705686a23e709b4e82a47 Mon Sep 17 00:00:00 2001 From: Kurt Heiden Date: Mon, 28 Oct 2024 12:45:02 -0600 Subject: [PATCH] Add ollama example usage file --- t3.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 t3.py diff --git a/t3.py b/t3.py new file mode 100644 index 0000000..1fb3124 --- /dev/null +++ b/t3.py @@ -0,0 +1,28 @@ +import simplemind + +aiclient = simplemind.Ollama() + +print('Messaging client') +message_response = aiclient.message(message="Once upon a time in a land far away...") +print(message_response) + +print('Generating Text') +generated_text = aiclient.generate_text(prompt="Once upon a time in a land far away...") +print(generated_text) + +print('Initiating Conversation') +conversation = aiclient.start_conversation() + +# Add a message to the conversation +conversation.say("Please remember the number 42") + +# Get the AI's response +reply = conversation.get_reply() +print(reply) + +# Add another message to the conversation +conversation.say("What number did I ask you to remember?") + +# Get the AI's response +reply = conversation.get_reply() +print(reply) \ No newline at end of file