Skip to content

Commit

Permalink
feat: defaults in setup()
Browse files Browse the repository at this point in the history
  • Loading branch information
gsuuon committed Dec 4, 2023
1 parent 2f548ce commit fe744c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 4 additions & 2 deletions lua/model/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,12 @@ end
---@field hl_group? string default = 'Comment'. Set the default highlight group of in-progress responses
---@field join_undo? boolean default = true. Join streaming response text as a single `u` undo. Edits during streaming will also be undone.

---@param opts SetupOptions
---@param opts? SetupOptions
function M.setup(opts)
M.opts = vim.tbl_extend('force', {
default_prompt = require('model.providers.openai').default_prompt
default_prompt = require('model.providers.openai').default_prompt,
prompts = require('model.prompts.starters'),
chats = require('model.prompts.chats')
}, opts or {})

if M.opts.prompts then
Expand Down
5 changes: 1 addition & 4 deletions plugin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ vim.filetype.add({
}
})

require('model').setup({
prompts = require('model.prompts.starters'),
chats = require('model.prompts.chats')
})
require('model').setup()

0 comments on commit fe744c9

Please sign in to comment.