briansunter / logseq-plugin-gpt3-openai

A plugin for GPT-3 AI assisted note taking in Logseq
https://twitter.com/bsunter
MIT License
717 stars 77 forks source link

"Logseq doesn't support multiple unordered lists or headings in a block." #125

Open thams opened 1 year ago

thams commented 1 year ago

OpenAI often returns text that looks like MD but trips up LogSeq. Then LogSeq doesn't display the response correctly, and gives a warning: "Full content not displayed; Logseq doesn't support multiple unordered lists or headings in a block."

To reproduce:

ask GPT "Create a study guide for learning large language model AI"

The response will be something like this:

1. Fundamentals of Artificial Intelligence
   - Understand the basic concepts, principles, and applications of artificial intelligence.
   - Familiarize yourself with different types of AI, including machine learning, deep learning, and natural language processing.

2. Introduction to Language Models
   - Learn about the purpose and functionality of language models.
   - Explore various types of language models, including rule-based approaches and statistical models.

Which shows up in Logseq like this:

Logseq

Unsure what the solution is. Replacing GPTs leading dashes with double-dashes might be the trick, but that might screw things up elsewhere.

usoonees commented 1 year ago

Use split-block plugin https://github.com/hyrijk/logseq-plugin-split-block

image

Result

image
thams commented 1 year ago

split-block works!

Would still be nice to have something that pre-parses GPT's responses in a way that is LogSeq friendly.

jumski commented 11 months ago

Split block indeed works and is a nice workaround.

But wondering the same as @thams - is it possible to output multiple blocks or trigger the split block plugin (if available) after creating a single block with unordered lists?

thams commented 11 months ago

I'm working on a pull request that would (optionally) parse the result and replace the unsupported leading dashes.

Would also make sense to simply add post-processing hooks that could do such things as trigger Split block or some arbitrary other tool.

bynr commented 5 months ago

Adding for reference for people looking for a simple solution that renders well.

I added this to the chat prompt:

Bullet points should use "*" and never "-".

Works like a charm if you are ok with the output to be within a single block! Screenshot from 2024-06-06 11-56-01