Hi Keith,
Ereyesterday, I encountered something which very much looks like a bug to me. I had already wanted to tell you about that then; but it was getting very late after I had finished going through those log files.
It appears that the sidebar chat can get stuck in the ‘Librarian onboarding flow’ with the tool ‘switch_to_document_mode’ doing nothing if ‘user.md’ was not yet filled in. The user is then not notified that the sidebar remains stuck in the ‘Librarian onboarding flow’ because no user preferences had been stored.
After trying out the ‘edit selection’ to see whether I had correctly connected WriterAgent with first LMStudio and then Ollama; I decided to try out the sidebar chat.
However, I ended up concluding that the model for some reason did not ‘see’ my document and was incapable of interacting with it; which seemed quite odd as your blog even had an example of the sidebar chat being used to translate a document.
When I went through the logs I discovered the existence of the ‘Librarian onboarding flow’* and decided to look up what it was by finding and skimming ‘librarian.py’ in the github repository. As it was not mentioned in readme.md or the description on extensions.libreoffice org, before this I had no idea such a thing existed.
However, when I attempted to get the sidebar to exit the ‘Librarian onboarding flow’ I discovered what very much looked like a bug to me:
When I later went through the logging I discovered that despite the model calling “switch_to_document_mode” it remained in the ‘Librarian onboarding flow’.
So, I once again went to look into your code in the Github repository; coincidentally I noticed that panel.py assigns ‘self._in_librarian_mode = True’ ‘if not user_md_exists’. So I concluded that it happened because it had not yet stored any of my ‘preferences’ in ‘user.md’.
Today, I had tried to first tell it a ‘favourite colour’ before attempting to switch to document mode, and it finally succeeded.
I got the sidebar chat to go over the first page and one by one provide feedback for the paragraphs there**.
As I do not think I am the only person whose reaction would be ‘I don’t see why my favourite colour is relevant, just start already’, I suspect that the ‘Librarian onboarding flow’ could be either better documented or reworked. On a sidenote, I think I myself would rather edit ‘preference settings’ myself rather than doing it via a chatbot; however, it could be I am the only one who thinks that so don’t take that as a suggestion.
If I find anything else I will post it on github; though, I’ll have to make a new account first, as I prefer to keep work and private accounts separate.
* Well, my actual reaction was more like: ‘so that was why that LLM kept asking me about my favourite colour, that was included in its instructions’…
** Even less of its ‘suggestions’ were ‘good’ than I had expected, it had even proposed I end a sentence with “…and escape routes for escaping.”. However, I haven’t yet had the time to try out different prompts and models; so I hope it eventually will get better.
It has the possibility to select single paragraphs and then through the right-click menu ‘ask AI’ such things as ‘add detected errors’, ‘revise paragraph stylistically’, ‘expand paragraph’, ‘find a synonym for this word’, ‘summarize’, or ‘translate’.
There also is a ‘general paragraph changes’ option which opens an ‘edit dialog’ which is a bit like your own ‘edit selection’ dialog but with more options and features.
Among others there is a seperate textbox displaying the ‘generated text’ complete with buttons such as ‘override paragraph’, ‘add to paragraph’, and ‘undo’; allowing the user more choice. A ‘temperature’ slider, a ‘select last paragraph’ button, and so on.
However, they work far from perfectly.
For example, when I had asked ‘Can you make the dialogue in this sentence appear more natural?’ the LLM had surrounded the text outputted in the ‘generated text’ field with:
Blockquote
Sure, here’s a more natural-sounding version of the dialogue:
—
<rewritten paragraph>
—
So that also gets placed in your text when click on ‘override paragraph’.
There also was an option to automatically ‘show suggestions for stylistic rewriting of paragraph in sidebar’. However, I did not yet found the time to test whether it even works in the first place.
I have also noticed that WritingTool appears to be incompatible with LM Studio.
I was planning anyway to test multiple models so I wonder whether I could maybe write something about which small local models I thought had worked best for me.
Though, I suppose that is something so context dependent people who aren’t fanfic writers who are writing in English despite that not being their first language might not learn much from that.