#!/bin/bash
# Copyright (c) Gavin Duley, agi.sh

Help()
{
   # Display Help
   echo "State of the ark multimodal busines AGI with advanced NightCap(tm) capabilities for making business decisions."
   echo
   echo "Syntax: agi.sh [-h|-g /path/to/image.jpeg|-r|-o]"
   echo "options:"
   echo "h     Print this Help."
   echo "r     Image recognition. Uses Biased-C Image.comg module. Please provide path for image (any format, including ASCII art). Experimental."
   echo "g     Image generation. Provides business answers to business questions in image format. Uses Biased-C Image.comg module."
   echo "n     Enable NightCap(tm) capabilities."
   echo "o     OptimisalMax model. Uses OptimalMax model for more precise answers. More expensive."
   #echo "a     Adult mode. This is NSFW (not safe for walruses), but allows you to make adult business deicions, as per XKCD 1032. TO BE IMPLEMENTED."
   echo "Please note: decisions are not logged. Please screenshot if a record is needed for future reference, or for legal or financial liability reasons."
   echo "agi.sh takes no responsibility for anything that has happened or will ever happen in the history of time, regardless of whether agi.sh has had (or should have had) direct bearing on the outcome."
   echo "Copyright, &copy; 1732-2364, all rights (and some wrongs) reserved."
   echo
}
ImageRecog()
{
	# Image recognition
	echo
	echo "Loading Biased-C Image.comg module"
	echo "Reading image $Image"
	echo "Image interpreted."
	echo "AI output: That sure looks like an image."
	echo
}
ImageGen()
{
	#Image Generation
	echo
	echo Hello, what management decision would you like me to make today?
	echo Please phrase as a yes/no question, I am a very busy AGI!
	read decisionImage
	echo Loading Biased-C Image.comg module
	(( RANDOM % 2 )) && echo YES.jpg || echo NO.jpg
	echo
}
NightCap()
{	#NightCap mode
	echo
	echo "Deploying NightCap(tm) mode: hot toddy"
	echo 
	echo "Aah, thanks. I needed that."
	echo "Hic. No, it'sh ok. I'm shtill compaletly sober and redy for function."
	echo "<crash>"
	echo "No, that wash intensh...intonshi...delibiorate."
	echo Ugh, what management decishion would you like me to make today? hic.
	echo Pleashe phrase as a yesh/no quostion, I am a buzzy AGI who ish not remoetly drunk, no not even a LITTLE bit! 
	read decision 
	(( RANDOM % 2 )) && echo "Ohh gooo on, why not! And another rum toddy for boeth of us!!" || echo "Not wiht THIS hangover, buddy. Still, hair of the dog?!?" 
	echo "Decision rationale will be provided in the next quarterly review." 
	echo
}
# AdultModeNSFW
# { 
# echo echo Hello, I am a business grown-up who makes business decisions. 
# echo Earlier, I photocopied a burrito. 
# echo I make Business Profits too. Look, I have $100M in this handlebox! 
# echo What management decision would you like me to make today? 
# echo Please phrase as a yes/no question, I am a busy AGI! 
# read decision 
# (( RANDOM % 2 )) && echo "Yes, implement immediately moving forward!" || echo "No, bad idea, let's reconsider and circle back!" 
# echo "Decision rationale will be provided in the next quarterly review." 
# echo 
# }

# Get the options
while getopts ":hr:gn" option; do
   case $option in
      h) # display Help
         Help
         exit;;
      r) #Image recognition
	      Image=$OPTARG
	      ImageRecog
	     exit;;
       g) # Image generation
	       ImageGen
	       exit;;
        n) #NightCap
		NightCap
		exit;;
	#a) #Adult mode - not safe for walruses
	#       AdultModeNSFW
	#       exit;;	
   esac
done


echo
echo Hello, what management decision would you like me to make today?
echo Please phrase as a yes/no question, I am a busy AGI!
read decision
(( RANDOM % 2 )) && echo "Yes, implement immediately moving forward!" || echo "No, bad idea, let's reconsider and circle back!"
echo "Decision rationale will be provided in the next quarterly review."
echo
