refactor: improve formatting of embed_extra and llm_extra (#2299)

This commit is contained in:
doodleEsc
2025-06-23 01:09:18 +08:00
committed by GitHub
parent 3033556d5b
commit 82cf18c6b9

View File

@@ -67,12 +67,12 @@ function M.launch_rag_service(cb)
local embed_extra = "{}" -- Default to empty JSON object string
if Config.rag_service and Config.rag_service.embed and Config.rag_service.embed.extra then
embed_extra = vim.json.encode(Config.rag_service.embed.extra):gsub('"', '\\"')
embed_extra = string.format("%q", vim.json.encode(Config.rag_service.embed.extra))
end
local llm_extra = "{}" -- Default to empty JSON object string
if Config.rag_service and Config.rag_service.llm and Config.rag_service.llm.extra then
llm_extra = vim.json.encode(Config.rag_service.llm.extra):gsub('"', '\\"')
llm_extra = string.format("%q", vim.json.encode(Config.rag_service.llm.extra))
end
local port = M.get_rag_service_port()