longy2k / obsidian-bmo-chatbot

Generate and brainstorm ideas while creating your notes using Large Language Models (LLMs) from Ollama, LM Studio, Anthropic, OpenAI, Mistral AI, and more for Obsidian.
https://ko-fi.com/longy2k
MIT License
261 stars 32 forks source link

Rename note title can output illegal characters (edit: caused by leading space) #67

Open Propheticus opened 3 months ago

Propheticus commented 3 months ago

Since note titles are used to name the corresponding .md file on the filesystem they should not contain characters that are illegal in filenames.

The output of the "Rename note title" is however causing my OneDrive to complain about illegal characters blocking it from syncing files.

EDIT: found out this is related to https://github.com/longy2k/obsidian-bmo-chatbot/issues/66 The output contains a leading space. This is not allowed in (NTFS) filenames. Simply going into explorer and renaming the file, not changing anything (just letting it auto-remove the space), fixes it.

EDIT2: The leading space is actually sent by the application I'm using to run LLM locally. Still would be a good idea to check and filter out illegal characters for titles that becomes file names.

Propheticus commented 3 months ago

Sorry, it's in the response from my local LLM. See below, before the word "Hello":

data: {"choices":[{"delta":{"content":" Hello"},"finish_reason":null,"index":0}],"created":1711886550,"id":"K75WwlMq7nBjqPW4FGlR","model":"_","object":"chat.completion.chunk"}

data: {"choices":[{"delta":{"content":" there"},"finish_reason":null,"index":0}],"created":1711886550,"id":"ADqnjtzqwx1zbUiWVXVm","model":"_","object":"chat.completion.chunk"}

caused by https://github.com/janhq/jan/issues/2548