briansunter/logseq-plugin-gpt3-openai

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

Opened this issue ยท 5 comments

thams commented

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.

thams commented

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

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

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

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