-
-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change model on the fly (#415)
* added a feature where the model parameter in openai_params can now be a function to allow dynamically changing the model. the readme has been updated appropriately. I have also added an example configuration with gpt-4-1106-preview to the readme after the configuration section. * on opening chat window, the model was not being collapsed for the settings panel. now doing this and testing if it works * testing using debug output * removed debug out again because it seems to now work magically? * debugging * debugging * still debugging * if the model is determined by a function, just display <dynamic> in settings menu * debugging * still debugging * had value, key instead of key, value in a for loop because I dont know lua lmao now testing * seems to be working, testing it now * debug output for model * typo in toMessages function in settings.lua, fixed now * more debugging * still debugging :( * vim.inspect missing * the plugin is tested and working, you can now switch models dynamically and if this is enabled, it will say <dynamic> in the chat settings. the completion features etc have not been tested with the changes, but they should be unaffected as I did not touch the openai_completion_params etc, only openai_params. if you want to see currently active model, add a shortcut to your config (because your config manages the model) * reformatted the config sample to be more readable. you can now pass a function as model to change the model used on the fly * finally, removed all debug notifications * Update api.lua * removed a goto statement by refactoring the code because goto does not work for some stylua versions and that's really annoying and unnecessary --------- Co-authored-by: Paper <[email protected]>
- Loading branch information
1 parent
df53728
commit a8b5520
Showing
5 changed files
with
134 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters