feat: LuaJIT worker-pool VM, multimodal/disable-thinking passthrough, WebUI redesign, DeepSeek V4

This commit is contained in:
root
2026-08-07 13:34:16 +08:00
parent a0e6e6da90
commit ccbcede581
16 changed files with 1733 additions and 425 deletions

View File

@ -19,11 +19,29 @@ function adapter.transform_request(raw_body)
}
}
-- 转换 messages 格式Ollama 兼容 OpenAI 的 messages 格式
-- 转换 messages 格式Ollama messages 支持 images base64 数组
if req.messages then
local msgs = {}
for _, m in ipairs(req.messages) do
table.insert(msgs, { role = m.role, content = m.content })
local text, images
if type(m.content) == "string" then
text, images = m.content, nil
else
text = ""
images = {}
for _, p in ipairs(m.content or {}) do
if p.type == "text" then
text = text .. (p.text or "")
elseif p.type == "image_url" and type(p.image_url) == "table" and p.image_url.url then
local b64 = string.match(p.image_url.url, "^data:[^,]+;base64,(.+)$")
if b64 then table.insert(images, b64) end
end
end
if #images == 0 then images = nil end
end
local msg = { role = m.role, content = text }
if images then msg.images = images end
table.insert(msgs, msg)
end
ollama_req.messages = msgs
end