Skip to content

Commit

Permalink
feat(vim): g:ai_assistant_model オプションでモデルを指定できるようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
micheam committed Jun 13, 2024
1 parent ded8382 commit 50d4bfc
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion plugin/ai_assistant.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
vim9script

# g:ai_assistant_model
#
# The model of the Assistant, e.g. `gpt-4`, `gpt-4-turbo`, `gpt-4o`, etc.
# The default value is `gpt-4-turbo`.
def AssistantModel(): string
if exists('g:ai_assistant_model')
return g:ai_assistant_model
endif
return 'gpt-4o'
enddef

def StartChatWindow()
var src_buf = bufnr('%')

Expand Down Expand Up @@ -81,7 +92,13 @@ def SendThread()
# Note: this tempfile will create every time we send a message.
const tempfile = $"{tempname()}.chat.message"
writefile(messages, tempfile)
const cmd = ["chat", "send", "-i", tempfile]
const cmd = [
"chat",
"--model", AssistantModel(),
"send",
"-i",
tempfile
]
const target_buf = bufnr('%')

def JobExitCB(job: job, status: number)
Expand Down

0 comments on commit 50d4bfc

Please sign in to comment.