{
"path": "/blog/2024-01-06-neat-simple-llm-use-for-text-manipulation",
"site": "at://did:plc:4vjd3fe2cgzq5d24j4f3zvar/site.standard.publication/3mjz2bzni752x",
"$type": "site.standard.document",
"title": "Neat simple LLM use for text manipulation",
"content": {
"$type": "dev.disnet.blog.content.markdown",
"markdown": "\nI had a neat little interaction with an LLM this week where I had a markdown note in Obsidian I wanted to convert some of its formatting. The note had a bunch of external markdown links:\n\n```\n- [Note1](app://obsidian.md/path/to/Note1)\n- [Note2](app://obsidian.md/path/to/Note2)\n- ...\n```\n\nthat I wanted to convert to internal links:\n\n```\n- [[Note1]]\n- [[Note2]]\n- ...\n```\n\nPreviously to do this I'd either reach for something like a [vim macro](https://vim.fandom.com/wiki/Macros) or write a little regex. Realistically for most cases the activation energy would be too much and I'd just not do the reformatting at all.\n\nBut with a LLM (in this case I used the [TextGen](https://text-gen.com/) plugin) you can just show an example and tell the LLM to do it and it just works. The prompt was something like\n\n```\n- [Note1](app://obsidian.md/path/to/Note1)\n- [Note2](app://obsidian.md/path/to/Note2)\n- ...\n\n---\n\nconvert the list above from `[Note](path/to/Note)` to `[[Note]]`\n```\n\nIt's pretty cool that we basically get a kind of [programming by example](https://en.wikipedia.org/wiki/Programming_by_example) for \"free\" with LLMs.",
"sourceFormat": "markdown"
},
"publishedAt": "2024-01-06T00:00:00.000Z",
"textContent": "I had a neat little interaction with an LLM this week where I had a markdown note in Obsidian I wanted to convert some of its formatting. The note had a bunch of external markdown links: that I wanted to convert to internal links: Previously to do this I'd either reach for something like a vim macro or write a little regex. Realistically for most cases the activation energy would be too much and I'd just not do the reformatting at all. But with a LLM (in this case I used the TextGen plugin) you can just show an example and tell the LLM to do it and it just works. The prompt was something like It's pretty cool that we basically get a kind of programming by example for \"free\" with LLMs."
}