chore(clipboard): separate logic to save as base64 and files (#329)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
@@ -61,18 +61,21 @@ M.get_user_message = function(opts)
|
||||
end
|
||||
|
||||
M.parse_message = function(opts)
|
||||
local user_content = {}
|
||||
---@type string | OpenAIMessage[]
|
||||
local user_content
|
||||
if Config.behaviour.support_paste_from_clipboard and Clipboard.has_content() then
|
||||
user_content = {}
|
||||
table.insert(user_content, {
|
||||
type = "image_url",
|
||||
image_url = {
|
||||
url = "data:image/png;base64," .. Clipboard.get_content(),
|
||||
url = "data:image/png;base64," .. Clipboard.get_base64_content(),
|
||||
},
|
||||
})
|
||||
table.insert(user_content, { type = "text", text = M.get_user_message(opts) })
|
||||
else
|
||||
user_content = M.get_user_message(opts)
|
||||
end
|
||||
|
||||
table.insert(user_content, { type = "text", text = M.get_user_message(opts) })
|
||||
|
||||
return {
|
||||
{ role = "system", content = opts.system_prompt },
|
||||
{ role = "user", content = user_content },
|
||||
|
||||
Reference in New Issue
Block a user