code: from llama_index.core.tools import FunctionTool
  import os
  note_file = os.path.join('data', 'notes.txt')
  
  def save_notes(note):
      if not os.path.exists(note_file):
          open(note_file, 'w')
  
      with open(note_file, 'a') as f:
          f.writelines([note + '\n'])
  
      return "Note saved"
  
  
  note_engine = FunctionTool.from_defaults(
      fn=save_notes,
      name="note_saver",
      description="Save text based note to a file for the user"
  )
apis: llama_index.core.tools.FunctionTool.from_defaults
extract_api: [((70, 103), 'os.path.join', 'os.path.join', (['"""data"""', '"""notes.txt"""'], {}), "('data', 'notes.txt')\n", (82, 103), False, 'import os\n'), ((308, 432), 'llama_index.core.tools.FunctionTool.from_defaults', 'FunctionTool.from_defaults', ([], {'fn': 'save_notes', 'name': '"""note_saver"""', 'description': '"""Save text based note to a file for the user"""'}), "(fn=save_notes, name='note_saver', description=\n    'Save text based note to a file for the user')\n", (334, 432), False, 'from llama_index.core.tools import FunctionTool\n'), ((138, 163), 'os.path.exists', 'os.path.exists', (['note_file'], {}), '(note_file)\n', (152, 163), False, 'import os\n')]