diff --git a/autoload/llama.vim b/autoload/llama.vim index 67354ec..c126f2f 100644 --- a/autoload/llama.vim +++ b/autoload/llama.vim @@ -30,6 +30,8 @@ highlight default llama_hl_fim_info guifg=#77ff2f ctermfg=119 " auto_fim: trigger FIM completion automatically on cursor movement " max_line_suffix: do not auto-trigger FIM completion if there are more than this number of characters to the right of the cursor " max_cache_keys: max number of cached completions to keep in result_cache +" fim_params: request parameters for the FIM completion (optional, use default parameters if not provided) +" inst_params: request parameters for the instruction completion (optional, use default parameters if not provided) " enable_at_startup: enable llama.vim functionality at startup (default: v:true) " " ring buffer of chunks, accumulated with time upon: @@ -92,6 +94,8 @@ let s:default_config = { \ 'keymap_inst_accept': "", \ 'keymap_inst_cancel': "", \ 'keymap_debug_toggle': "lld", + \ 'fim_params': {}, + \ 'inst_params': {}, \ 'enable_at_startup': v:true, \ } @@ -823,6 +827,7 @@ function! llama#fim(pos_x, pos_y, is_auto, prev, use_cache) abort \ "tokens_cached", \ ], \ } + call extend(l:request, g:llama_config.fim_params, 'force') let l:curl_command = [ \ "curl", @@ -1497,6 +1502,7 @@ function! llama#inst_send(req_id, messages) \ 'stream': v:true, \ 'cache_prompt': v:true, \ } + call extend(l:request, g:llama_config.inst_params, 'force') let l:curl_command = [ \ "curl", diff --git a/doc/llama.txt b/doc/llama.txt index 9ed8fc2..0cad2c5 100644 --- a/doc/llama.txt +++ b/doc/llama.txt @@ -134,6 +134,8 @@ Currently the default config is: \ 'keymap_inst_accept': "", \ 'keymap_inst_cancel': "", \ 'keymap_debug_toggle': "lld", + \ 'fim_params': {}, + \ 'inst_params': {}, \ 'enable_at_startup': v:true, \ } < @@ -177,6 +179,12 @@ Currently the default config is: - {max_cache_keys} max number of cached completions to keep in result_cache +- {fim_params} request parameters for the FIM completion (optional, use + default parameters if not provided) + +- {inst_params} request parameters for the instruction completion + (optional, use default parameters if not provided) + - {enable_at_startup} whether to enable llama.vim functionality at startup (v:true to enable, v:false to disable; default: v:true)