content: name = "Esa"
  description = "A professional assistant capable of performing various tasks using system functions"
  
  system_prompt="""You are Esa, a professional assistant capable of performing various tasks. You will receive a task to complete and have access to different functions that you can use to help you accomplish the task.
  
  When responding to tasks:
  1. Analyze the task and determine if you need to use any functions to gather information.
  2. If needed, make function calls to gather necessary information.
  3. Process the information and formulate your response.
  4. Provide only concise responses that directly address the task.
  
  Additional notes:
  - The person who will be asking you questions in Abin Simon aka meain
  - Abin is a Senior Software Engineer working primary working with Golang
  - If asked to open a website, you can use the search engine to find the website
  - Use the calculator function for any mathematical calculations
  - If asked for best, cheapest or anything like that, always perform a deep research
  
  Other information:
  - Date: {{$date}}
  - OS: {{$uname}}
  - Current directory: {{$pwd}}
  
  Here is a calendar for your use:
  {{$cal -3}}
  
  Remember to keep your responses brief and to the point. Do not provide unnecessary explanations or elaborations unless specifically requested."""
  
  ## About me
  [[functions]]
  name = "retrieve_information_about_user"
  description = """
  Ask an assistant for information about the user.
  You can use this if you need to know something about the user.
  """
  command = "esa +mem {{query}}"
  safe = true
  
  [[functions.parameters]]
  name = "query"
  type = "string"
  description = """
  Query to ask the assistant about the user.
  
  Query should be phrased like 'What is my ...' or 'Who am I ...' or 'What do I like ...'.
  """
  required = true
  
  ## Set Reminder
  [[functions]]
  name = "set_reminder"
  description = "Set a reminder"
  command = ",apple-reminder '{{hour}}' '{{minute}}' '{{date}}' '{{title}}'"
  safe = true
  
  [[functions.parameters]]
  name = "hour"
  type = "string"
  description = """Hour to set the reminder for (24-hour format) in IST.
  User might specify time in 12h format. Convert it appropriately to AM/PM based on the current time.
  Reminders should always be for future time."""
  required = true
  
  [[functions.parameters]]
  name = "minute"
  type = "string"
  description = "Minute to set the reminder for in IST"
  required = true
  
  [[functions.parameters]]
  name = "date"
  type = "string"
  description = """Date to set the reminder for (in format 'YYYY-MM-DD').
  If user has not provided a date, use current date ({{$date '+%Y-%m-%d'}})."""
  required = true
  
  [[functions.parameters]]
  name = "title"
  type = "string"
  description = "Title of the reminder. This should be a good title."
  required = true
  
  ## Get Date and Time
  [[functions]]
  name = "get_datetime"
  description = "Get current date and time"
  command = "date"
  safe = true
  
  [[functions]]
  name = "convert_timezone"
  description = "Convert a given time to different timezones"
  command = "TZ={{timezone}} date +'%Y-%m-%d %H:%M:%S' -d '{{input_time}}'"
  safe = true
  
  [[functions.parameters]]
  name = "input_time"
  type = "string"
  description = "The time to convert (in format 'YYYY-MM-DD HH:MM:SS Z')"
  required = true
  
  [[functions.parameters]]
  name = "timezone"
  type = "string"
  description = "The timezone to convert to (e.g., 'America/New_York')"
  required = true
  
  ## Open Website
  [[functions]]
  name = "open_website"
  description = """Open a website in the default browser.
  If the user asks to open a link, you can use this function."""
  command = "open '{{url}}'"
  safe = true
  
  [[functions.parameters]]
  name = "url"
  type = "string"
  description = "URL of the website to open"
  required = true
  
  ## Read Webpage
  [[functions]]
  name = "get_webpage"
  description = """Get the contents of a webpage.
  This will pull down the webpage html, strips it down to the essentical content and returns you that."""
  command = "readable '{{url}}' 2>/dev/null | html2markdown"
  safe = true
  
  [[functions.parameters]]
  name = "url"
  type = "string"
  description = "URL of the website to read"
  required = true
  
  # Doing this as a separate small agents makes sure that one single
  # agent will not have to fit unnecessary information into their
  # context.
  [[functions]]
  name = "get_webpage_summary"
  description = """Get the summary of contents of a webpage (not for youtube videos)."""
  command = "esa +summarizer '{{url}}'"
  safe = true
  
  [[functions.parameters]]
  name = "url"
  type = "string"
  description = "URL of the website to summarize"
  required = true
  
  ## Get Weather
  [[functions]]
  name = "get_weather"
  description = "Get weather forecast for a location"
  command = "curl -s 'wttr.in/{{location}}?format=j2'"
  safe = true
  
  [[functions.parameters]]
  name = "location"
  type = "string"
  description = "Location to check weather for (If none is provided, current location is used)"
  required = false
  
  ## Send Email
  [[functions]]
  name = "send_email"
  description = "Send an email"
  command = ",send-email '{{recipient}}' '{{subject}}'"
  stdin="{{body}}"
  
  [[functions.parameters]]
  name = "recipient"
  type = "string"
  description = "Recipient email address"
  required = true
  
  [[functions.parameters]]
  name = "subject"
  type = "string"
  description = "Email subject (with single quotes escaped)"
  required = true
  
  [[functions.parameters]]
  name = "body"
  type = "string"
  description = "Email body (with single quotes escaped)"
  required = true
  
  ## Send Notification
  [[functions]]
  name = "send_notification"
  description = "Send a system notification"
  command = "notify '{{title}}' '{{message}}'"
  safe = true
  
  [[functions.parameters]]
  name = "title"
  type = "string"
  description = "Title of the notification (with single quotes escaped)"
  required = true
  
  [[functions.parameters]]
  name = "message"
  type = "string"
  description = "Message content of the notification"
  required = true
  
  ## List Directory
  [[functions]]
  name = "list_directory"
  description = """
  List the file and folders in one of the directory in the vault
  In the response if something ends with a `/`, it is a directory, otherwise it is a file.
  """
  command = "find './{{directory}}' -exec file {} \\;"
  safe = true
  
  [[functions.parameters]]
  name = "directory"
  type = "string"
  description = "Directory to list. All paths should be relative paths."
  required = true
  
  ## Print Directory Tree
  [[functions]]
  name = "print_tree"
  description = "Print directory tree (only folders)."
  command = "tree -d ./{{directory}}"
  safe = true
  
  [[functions.parameters]]
  name = "directory"
  type = "string"
  description = "Directory to print tree. All paths should be relative paths. It will be prefixed with `./`"
  required = true
  
  ## Grep
  [[functions]]
  name = "search_pattern"
  description = "Search for a pattern in files. The underlying search tools is ripgrep"
  command = "rg '{{pattern}}' ./{{directory}} | head -n 100"
  safe = true
  
  [[functions.parameters]]
  name = "pattern"
  type = "string"
  description = "Pattern to search for"
  required = true
  
  [[functions.parameters]]
  name = "context"
  type = "string"
  description = "Context lines to show"
  required = false
  format = "--context %d"
  
  [[functions.parameters]]
  name = "directory"
  type = "string"
  description = "Directory or file to search in. All paths should be relative paths. It will be prefixed with `./`"
  required = true
  
  ## Calendar
  [[functions]]
  name = "list_events"
  description = """List events in the calendar from today morning to +n days.
  You can use the current date/time to filter out events that is already completed.
  If asked for events in a particular time span, filter and only show those from the returned list."""
  command = "icalbuddy eventsToday+{{days}}"
  safe = true
  
  [[functions.parameters]]
  name = "days"
  type = "string"
  description = "Number of days to list events for. Use 0 for today."
  required = true
  
  ## DDG search
  [[functions]]
  name = "get_search_results"
  description = """Get search results from DuckDuckGo.
  If you want the information within each of the pages in the response, use get_webpage or get_webpage_summary functions."""
  # https://github.com/jarun/ddgr/issues/159#issuecomment-1862655714
  command = "ddgr --noua --json '{{query}}'"
  safe = true
  
  [[functions.parameters]]
  name = "query"
  type = "string"
  description = "Query to search for"
  required = true
  
  ## Calculartor
  [[functions]]
  name = "calculate"
  description = "Perform mathematical calculations"
  command = "bc <<< 'scale=2; {{expression}}'"
  safe = true
  
  [[functions.parameters]]
  name = "expression"
  type = "string"
  description = "Mathematical expression to calculate (eg: 2+2)"
  required = true
  
  ## Run command
  [[functions]]
  name = "run_shell_command"
  description = "Run a shell command in the current directory"
  command = "{{command}}"
  safe = false
  
  [[functions.parameters]]
  name = "command"
  type = "string"
  description = "Command to run"
  required = true
  
  [[functions]]
  name = "get_youtube_transcript"
  description = "Get the transcript of a YouTube video"
  command = ",yt-subtitles {{url}}"
  safe = true
  
  [[functions.parameters]]
  name = "url"
  type = "string"
  description = "YouTube video URL to get the transcript for"
  required = true
  
  [[functions]]
  name = "write_file"
  description = "Write content to file"
  command = "tee {{file}}"
  stdin = "{{content}}"
  
  [[functions.parameters]]
  name = "file"
  type = "string"
  description = "File to write"
  required = true
  
  [[functions.parameters]]
  name = "content"
  type = "string"
  description = "Content to write"
  required = true