Merge branch 'v4-fzy' into test
This commit is contained in:
commit
cdac506f56
|
|
@ -70,11 +70,18 @@ func (c *CallbackBiz) issueHandlingExtractContent(data chatbot.BotCallbackDataMo
|
||||||
Model: c.cfg.Ollama.GenerateModel,
|
Model: c.cfg.Ollama.GenerateModel,
|
||||||
Prompt: prompt,
|
Prompt: prompt,
|
||||||
Stream: util.AnyToPoint(false),
|
Stream: util.AnyToPoint(false),
|
||||||
|
Think: &api.ThinkValue{Value: false},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("问题提取失败: %v", err)
|
log.Errorf("问题提取失败: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 尝试清理 JSON 内容(有时模型会返回 markdown 块)
|
||||||
|
generateResp.Response = strings.TrimPrefix(generateResp.Response, "```json")
|
||||||
|
generateResp.Response = strings.TrimSuffix(generateResp.Response, "```")
|
||||||
|
generateResp.Response = strings.TrimSpace(generateResp.Response)
|
||||||
|
|
||||||
// 解析 JSON 响应
|
// 解析 JSON 响应
|
||||||
var resp struct {
|
var resp struct {
|
||||||
Question string `json:"question"`
|
Question string `json:"question"`
|
||||||
|
|
|
||||||
|
|
@ -927,6 +927,7 @@ func (d *DingTalkBotBiz) createIssueHandlingGroupAndInit(ctx context.Context, ca
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// 初始化群聊
|
// 初始化群聊
|
||||||
|
time.Sleep(time.Millisecond * 200) // 等待机器人加入群聊
|
||||||
groupScope := callbackParams["group_scope"].(string) // 群主题
|
groupScope := callbackParams["group_scope"].(string) // 群主题
|
||||||
d.initIssueHandlingGroup(appKey, openConversationId, groupScope)
|
d.initIssueHandlingGroup(appKey, openConversationId, groupScope)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue