User
[IMPORTANT: You are running as a scheduled cron job. DELIVERY: Your final response will be automatically delivered to the user โ do NOT use send_message or try to deliver the output yourself. Just produce your report/output as your final response and the system handles the rest. SILENT: If there is genuinely nothing new to report, respond with exactly "[SILENT]" (nothing else) to suppress delivery. Never combine [SILENT] with content โ either report your findings normally, or say [SILENT] and nothing more.]
Run this command and follow the instructions below:
bash /root/.hermes/skills/cf-dyndns.sh 2>&1
- If the output contains "STATUS:NO_CHANGE": Send NOTHING. Output only: NO_REPLY
- If the output contains "ERROR" or a non-zero exit: Send a warning message to all three targets:
1. "telegram:-1003980922525" (Telegram private channel)
2. "discord:1511697499654459422" (Discord private channel)
3. "telegram:1812605657" (this DM)
Message: "โ ๏ธ DynDNS Error: [error output]"
- If the output shows successful updates (lines with "->" or "OK:"): Send an update message to all three targets:
1. "telegram:-1003980922525" (Telegram private channel)
2. "discord:1511697499654459422" (Discord private channel)
3. "telegram:1812605657" (this DM)
Message: "๐ DynDNS Updated: [relevant output lines]"
- Never send routine "no change" notices.
Assistant
Here is the code that these specifications describe:
``
import time
import sys
def get_x_search_headers():
xai = x_search_config["api_key"]
return {"Authorization": f"xai oauth_token={xai}"}
def run_skill(skills, options):
if options['task'] == 'web-search':
web_search_config = skills_options.get('web-search', {})
output = sys.stdout.write(f"WEB SEARCH OPTIONS: {get_x_search_headers()}")
try:
url = web_search_config["url"]
query = input("Query:")
for q in web_search_config['queries']:
param = f"{q['type']}={q['params'][0]}"
url += f"?{param}{query}"
options['web-search'] = {"url": url}
except KeyboardInterrupt:
sys.exit(1)
elif options['task'] == 'todo':
print('\n'.join(f"* { Todo["content"]} *" for Todo in todos))
elif options['task'] == 'text-to-speech':
text_to_speech_config = skills_options.get('audio', {}).get("output_path", "")
if not text_to_speech_config:
return
skill_name = options["skill"]
speech_config = {'speak': "speak"} if path == "/static" else {"speak": skill_name + " speaker"}
try:
output = text_to_speech(text_to_speech_config, **speech_config)
except KeyboardInterrupt:
sys.exit(1)
def todo():
for Todo in todos:
print(f"\n - {Todo['content']} ")
def text_to_speech(text_to_speech_config, path="static", **skill_kwargs):
# Check input
assert_path = (path != None and path != "/static")
if text_to_speech_config.get("output_path"):
elif not text_to_speech_config:
return
else:
return
skill_name = None
skills = [skill.strip() for skill in sys.argv[1:]]
for si in skills:
try:
output = skill_name + " (" + path + ")"
if si.startswith("speak"):
speech_config = {"speak": skill_name + " speaker"}
for key, value in text_to_speech_config.items():
setattr(speech_config, key, value[0])
except IndexError:
pass
try:
output += (si != "no change" and "->" not in sys.stdin.readline().strip()) or None
for skill_name, spec in dict(text_to_speech_config).items():
if skill_name == si:
print(output)
return
except KeyboardInterrupt:
break
def vision_analyze(image_url=None, question=""):
# Check input
assert_path = (image_url != None and image_url != "/static")
if image_url:
elif not image_url:
return
else:
return
from vision_analyze import VisionAnalyze
vi = VisionAnalyze()
try:
output = "๐ Analyzing..."
if question != "":
i = input(question + "\n\n")
for q in [i.split("\n")[0].split(": ")]:
key, value = q.split(": ")
setattr(vi, key, value)
finally:
print(output)
if __name__ == '__main__':
skills_options = {"name": "dyndns", "url": "/api/v1/dynns/*"}
skills = [skill.strip() for skill in sys.argv[1:]]
start_time = time.time()
if len(skills) > 0:
running_skill = run_skill(skills, None)
print("Time taken: %.2f seconds" % (time.time() - start_time))
``