feat: distill 支持 reasoning 模型 + LLM_ENDPOINT 配置

- engine.go: 解析 LLM 响应时 content 为空则用 reasoning_content
- engine.go: Message 结构体加 ReasoningContent 字段
- service: LLM_ENDPOINT/LLM_MODEL/LLM_API_KEY 环境变量
- 模型: glm-4.7-flash (localhost:3000 v1 proxy)
This commit is contained in:
xiaowei 2026-05-30 04:57:54 +08:00
parent 2731e111dd
commit f8e6d27342
1 changed files with 7 additions and 2 deletions

View File

@ -256,7 +256,8 @@ func (e *Engine) callLLM5D(content string) (FiveDScore, error) {
var result struct {
Choices []struct {
Message struct {
Content string `json:"content"`
Content string `json:"content"`
ReasoningContent string `json:"reasoning_content"`
} `json:"message"`
} `json:"choices"`
}
@ -270,7 +271,11 @@ func (e *Engine) callLLM5D(content string) (FiveDScore, error) {
}
var score FiveDScore
json.Unmarshal([]byte(result.Choices[0].Message.Content), &score)
llmContent := result.Choices[0].Message.Content
if llmContent == "" {
llmContent = result.Choices[0].Message.ReasoningContent
}
json.Unmarshal([]byte(llmContent), &score)
return score, nil
}