obsidian-textgenerator-plugin icon indicating copy to clipboard operation
obsidian-textgenerator-plugin copied to clipboard

[Bug] API cannot be saved correctly when using custom LLM

Open wwjCMP opened this issue 9 months ago • 7 comments

The API used is very long, and I'm not sure if that's what's causing the issue.

wwjCMP avatar May 03 '24 18:05 wwjCMP

more details please to reproduce the issue

nhaouari avatar May 04 '24 13:05 nhaouari

I believe that only three things are needed to reproduce this issue:

  1. Use a custom LLM provider
  2. Use a long api key
  3. Restart obsidian

wwjCMP avatar May 05 '24 03:05 wwjCMP

Same issue here. Even when saving the profile, the key is not there on restart. Re-importing the profile also doesnt import the key.

stisa avatar May 22 '24 15:05 stisa

+1,i also meet this issue

calmwaves111 avatar May 23 '24 23:05 calmwaves111

I can confirm that custom provider API keys do not survive a restart of Obsidian or a plugin reload. (Also tested with 0.7.19-beta)

Update with workaround:

  1. Make sure your key(s) are in place and work.
  2. Under "Text Generator Options" in the settings for Textgenerator there is a toggle for "Keys encryption". Toggle this option on.
  3. After adding or changing a key, toggle above option off and then on again to update the keys on disk.

fry69 avatar May 31 '24 02:05 fry69

https://github.com/nhaouari/obsidian-textgenerator-plugin/commit/2031843f0653c0fbe79911f329acfa16319b634d (included in release 0.7.27+) seems to have fixed this issue, at least for me.

fry69 avatar Aug 04 '24 11:08 fry69

This just happened to me in 0.7.28.

  1. Using Azure OpenAI Chat with the following parameters filled: Api key, Endpoint, Deployment name, API version.
  2. Confirmed working yesterday.
  3. Computer put to sleep overnight (plugin not reloaded manually and Obsidian was not shutdown).
  4. Today all parameters are gone.

secastles avatar Aug 09 '24 17:08 secastles