feat(azure): support vision (#354)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
parent
93ca541262
commit
5c1861d93f
@ -45,13 +45,19 @@ M.paste_image = function(line)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return ImgClip.paste_image({
|
local opts = {
|
||||||
dir_path = paste_directory:absolute(),
|
dir_path = paste_directory:absolute(),
|
||||||
prompt_for_file_name = false,
|
prompt_for_file_name = false,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
AvanteInput = { url_encode_path = true, template = "\nimage: $FILE_PATH\n" },
|
AvanteInput = { url_encode_path = true, template = "\nimage: $FILE_PATH\n" },
|
||||||
},
|
},
|
||||||
}, line)
|
}
|
||||||
|
|
||||||
|
if vim.fn.has("wsl") > 0 or vim.fn.has("win32") > 0 then
|
||||||
|
opts.use_absolute_path = true
|
||||||
|
end
|
||||||
|
|
||||||
|
return ImgClip.paste_image(opts, line)
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param filepath string
|
---@param filepath string
|
||||||
|
@ -13,14 +13,7 @@ local M = {}
|
|||||||
|
|
||||||
M.api_key_name = "AZURE_OPENAI_API_KEY"
|
M.api_key_name = "AZURE_OPENAI_API_KEY"
|
||||||
|
|
||||||
M.parse_message = function(opts)
|
M.parse_message = O.parse_message
|
||||||
local user_content = O.get_user_message(opts)
|
|
||||||
return {
|
|
||||||
{ role = "system", content = opts.system_prompt },
|
|
||||||
{ role = "user", content = user_content },
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
M.parse_response = O.parse_response
|
M.parse_response = O.parse_response
|
||||||
|
|
||||||
M.parse_curl_args = function(provider, code_opts)
|
M.parse_curl_args = function(provider, code_opts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user