From 4cb86362752de14d142bca796688af0bf9277215 Mon Sep 17 00:00:00 2001 From: Martin Bielik Date: Thu, 5 Dec 2024 19:43:24 +0100 Subject: moving from legacy completions api --- doc/vim-ai.txt | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'doc') diff --git a/doc/vim-ai.txt b/doc/vim-ai.txt index b5674e9..273f074 100644 --- a/doc/vim-ai.txt +++ b/doc/vim-ai.txt @@ -21,17 +21,28 @@ https://github.com/madox2/vim-ai :AI {instruction} complete the selection using the instruction Options: > - let g:vim_ai_complete = { - \ "engine": "complete", + let s:initial_complete_prompt =<< trim END + >>> system + + You are a general assistant. + Answer shortly, consisely and only what you are asked. + Do not provide any explanantion or comments if not requested. + If you answer in a code, do not wrap it in markdown blocks. + END + + let g:vim_ai_complete_default = { + \ "engine": "chat", \ "options": { - \ "model": "gpt-3.5-turbo-instruct", - \ "endpoint_url": "https://api.openai.com/v1/completions", - \ "max_tokens": 1000, + \ "model": "gpt-4o", + \ "endpoint_url": "https://api.openai.com/v1/chat/completions", + \ "max_tokens": 0, + \ "max_completion_tokens": 0, \ "temperature": 0.1, \ "request_timeout": 20, \ "stream": 1, \ "enable_auth": 1, \ "selection_boundary": "#####", + \ "initial_prompt": s:initial_complete_prompt, \ }, \ "ui": { \ "paste_mode": 1, @@ -48,17 +59,28 @@ https://platform.openai.com/docs/api-reference/completions the instruction Options: > - let g:vim_ai_edit = { - \ "engine": "complete", + let s:initial_complete_prompt =<< trim END + >>> system + + You are a general assistant. + Answer shortly, consisely and only what you are asked. + Do not provide any explanantion or comments if not requested. + If you answer in a code, do not wrap it in markdown blocks. + END + + let g:vim_ai_edit_default = { + \ "engine": "chat", \ "options": { - \ "model": "gpt-3.5-turbo-instruct", - \ "endpoint_url": "https://api.openai.com/v1/completions", - \ "max_tokens": 1000, + \ "model": "gpt-4o", + \ "endpoint_url": "https://api.openai.com/v1/chat/completions", + \ "max_tokens": 0, + \ "max_completion_tokens": 0, \ "temperature": 0.1, \ "request_timeout": 20, \ "stream": 1, \ "enable_auth": 1, \ "selection_boundary": "#####", + \ "initial_prompt": s:initial_complete_prompt, \ }, \ "ui": { \ "paste_mode": 1, -- cgit v1.2.3