Created
December 31, 2023 11:29
-
-
Save business24ai/ffc275267b9c928805756fe6dace19b0 to your computer and use it in GitHub Desktop.
An AutoGen Studio skill to store markdown content to our second brain obsidian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A skill to store markdown content to our second brain obsidian | |
import os | |
def store_note_to_obsidian(filename, content): | |
""" | |
Store markdown content to our second brain in a local Obsidian vault | |
:param filename: str, filename of the note | |
:param content: str, content of the note as markdown | |
""" | |
# Path to Obsidian vault | |
obsidian_dir = r'C:/1600/2nd_brain/1600_agent_swarm/' | |
# Add .md suffix if not present | |
if not filename.endswith('.md'): | |
filename += '.md' | |
# full path prefix obsidian_dir to filename | |
full_path = os.path.join(obsidian_dir, filename) | |
# Write content to file | |
with open(full_path, 'w') as file: | |
file.write(content) | |
## To test the skill | |
#if __name__ == '__main__': | |
# store_note_to_obsidian("Test", "This is a **test** ==markdown== note!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment