mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-09-22 18:07:58 +00:00
fix(adapters): reflow live sensenova reasoning field, add trae adapter
sensenova: the deployed /etc/llmsproxy/adapters/sensenova.lua carried a fix that never made it back into the repo — sensenova-6.8-flash-lite reports its chain of thought in `reasoning` rather than `reasoning_content`, in both the single-shot response and the stream deltas. Without this the model's output looked empty. Repo and deployment now match byte for byte. trae: the adapter was in use on this deployment but untracked, so a fresh install had no way to serve the trae source.
This commit is contained in:
@ -57,6 +57,9 @@ function adapter.transform_response(raw_body)
|
||||
unified.content = ch.message.content or ""
|
||||
if ch.message.reasoning_content then
|
||||
unified.reasoning_content = ch.message.reasoning_content
|
||||
elseif ch.message.reasoning then
|
||||
-- sensenova-6.8-flash-lite 用 reasoning 字段而不是 reasoning_content
|
||||
unified.reasoning_content = ch.message.reasoning
|
||||
end
|
||||
end
|
||||
unified.finish_reason = ch.finish_reason or ""
|
||||
@ -97,10 +100,11 @@ function adapter.transform_stream_chunk(raw_chunk)
|
||||
|
||||
local delta = chunk.choices[1].delta or {}
|
||||
|
||||
-- Sensenova: delta has reasoning_content but no content
|
||||
-- Sensenova: delta has reasoning_content (deepseek-v4-flash) or reasoning
|
||||
-- (sensenova-6.8-flash-lite) but no content field
|
||||
local content = delta.content or ""
|
||||
if content == "" and delta.reasoning_content then
|
||||
content = delta.reasoning_content
|
||||
if content == "" and (delta.reasoning_content or delta.reasoning) then
|
||||
content = delta.reasoning_content or delta.reasoning
|
||||
end
|
||||
|
||||
-- Sensenova: finish_reason is "" on every chunk, "stop" on last
|
||||
|
||||
Reference in New Issue
Block a user