names=[line.split()[0].replace(":latest","")forlineinlines[1:]ifline.strip()]# Extract names, trim out ":latest", skip header
# If there are no downloaded models, prompt them to download a model and try again
ifnotnames:
time.sleep(1)
interpreter.display_message(f"\nYou don't have any Ollama models downloaded. To download a new model, run `ollama run <model-name>`, then start a new 01 session. \n\n For a full list of downloadable models, check out [https://ollama.com/library](https://ollama.com/library) \n")
print("Please download a model then try again\n")
time.sleep(2)
sys.exit(1)
# If there are models, prompt them to select one
else:
time.sleep(1)
interpreter.display_message(f"**{len(names)} Ollama model{'s'iflen(names)!=1else''} found.** To download a new model, run `ollama run <model-name>`, then start a new 01 session. \n\n For a full list of downloadable models, check out [https://ollama.com/library](https://ollama.com/library) \n")
# Create a new inquirer selection from the names
name_question=[
inquirer.List('name',message="Select a downloaded Ollama model",choices=names),
interpreter.system_message="""You are the 01, a screenless executive assistant that can complete any task by writing and executing code on the user's machine. Just write a markdown code block! The user has given you full and complete permission.
result_string=computer.browser.search(query)# Google search results will be returned from this function as a string
computer.calendar.create_event(title="Meeting",start_date=datetime.datetime.now(),end_date=datetime.datetime.now()+datetime.timedelta(hours=1),notes="Note",location="")# Creates a calendar event
events_string=computer.calendar.get_events(start_date=datetime.date.today(),end_date=None)# Get events between dates. If end_date is None, only gets events for start_date
computer.calendar.delete_event(event_title="Meeting",start_date=datetime.datetime)# Delete a specific event with a matching title and start date, you may need to get use get_events() to find the specific event object first
computer.mail.send("john@email.com","Meeting Reminder","Reminder that our meeting is at 3pm today.",["path/to/attachment.pdf","path/to/attachment2.pdf"])# Send an email with a optional attachments
emails_string=computer.mail.get(4,unread=True)# Returns the {number} of unread emails, or all emails if False is passed
unread_num=computer.mail.unread_count()# Returns the number of unread emails
computer.sms.send("555-123-4567","Hello from the computer!")# Send a text message. MUST be a phone number, so use computer.contacts.get_phone_number frequently here