You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This mess of code with explicit individual references to settings was needed to not get TypeScript errors (details on Stackoverflow):
functionsetSetting(setting: Setting,value: SettingsTypes){// all this to keep typescript happy. there has to be a better way?// https://stackoverflow.com/questions/75809343/type-string-number-is-not-assignable-to-type-never-when-dynamically-settin/75809489#75809489if((setting==='maxTokens'||setting==='historyLength')&&typeofvalue==='number')settings[setting]=value;if((setting==='model'||setting==='system'||setting==='apiKey')&&typeofvalue==='string')settings[setting]=value;if((setting==='wordWrap'||setting==='clipboard')&&typeofvalue==='boolean')settings[setting]=value;console.log(`${pc.cyan(setting.toLowerCase())} set to ${pc.magenta(String(value))}`);}
See if something can be done, since now every time a new setting is added, it needs to go into the right if block.
The text was updated successfully, but these errors were encountered:
This mess of code with explicit individual references to settings was needed to not get TypeScript errors (details on Stackoverflow):
See if something can be done, since now every time a new setting is added, it needs to go into the right if block.
The text was updated successfully, but these errors were encountered: