Submission Number: 109
Submission ID: 103
Submission UUID: a76f41cf-2828-4d1c-9a41-48fee77808c3
Submission URI: /Script

Created: Thu, 03/09/2023 - 07:58
Completed: Thu, 03/09/2023 - 07:58
Changed: Thu, 03/09/2023 - 07:58

Remote IP address: 146.70.117.227
Submitted by: Anonymous
Language: English

Is draft: No
Webform: Script
Submitted to: Script Upload

Script

Re-name Neon
This skill allows the user to rename Neon and save the new
name to Neon's AI's Bootable USB Drive for the Mark II.

Activation Phrase: "Hey Neon, rename yourself."

Sample Utterances:

"Change your name to [new name]."
"Can you call yourself [new name] from now on?"
"I want to give you a new name. Let's call you [new name]."

Skill Steps:

Neon AI will prompt the user to provide a new name for it.
The user will provide the new name.
Neon AI will confirm the new name and ask the user if they want to
save it. If the user confirms, Neon AI will save the new name to its
Bootable
USB Drive for the Mark II and reply with a confirmation message.
If the user does not confirm, Neon AI will ask if the user wants to
try again or end the session.
import neon
import os

app = neon.Application()

@app.handle(intent='rename_neon')
def rename_neon_handler(request, responder):
new_name = request.slot_value('new_name')

# Confirm the new name and ask the user if they want to save it
confirmation_message = f"Are you sure you want to change my name to
{new_name}?"
confirmation = responder.yes_or_no(confirmation_message)

if confirmation == 'yes':
# Save the new name to Neon's AI's Bootable USB Drive for the
Mark II
bootable_drive_path = "/boot"
new_name_file_path = os.path.join(bootable_drive_path,
"neon_name.txt")
with open(new_name_file_path, "w") as f:
f.write(new_name)
responder.reply(f"My new name is now {new_name}.")
else:
# Ask the user if they want to try again or end the session
retry_message = "Do you want to try again or end this session?"
retry = responder.yes_or_no(retry_message)
if retry == 'yes':
responder.listen()
else:
responder.reply("Okay, see you next time!")

app.run()

Author

Adam Obradovic
{Empty}
{Empty}