|
@@ -111,9 +111,9 @@ func AIGCBaseOnPromote(aigc AIGC) (resp bus_response.AIGCEtaResponse, err error)
|
|
kbId = mapping.KbId
|
|
kbId = mapping.KbId
|
|
}
|
|
}
|
|
//知识库对话
|
|
//知识库对话
|
|
- response, httpErr := llmService.FileChat(aigc.Promote, kbId, nil)
|
|
|
|
|
|
+ response, httpErr := llmService.FileChat(aigc.Promote, kbId, aigc.LLMModel, nil)
|
|
if httpErr != nil {
|
|
if httpErr != nil {
|
|
- utils.FileLog.Error("内容生成失败,err:", err.Error())
|
|
|
|
|
|
+ utils.FileLog.Error("内容生成失败,err:", httpErr.Error())
|
|
err = fmt.Errorf("内容生成失败,err:%v", httpErr)
|
|
err = fmt.Errorf("内容生成失败,err:%v", httpErr)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -129,7 +129,15 @@ func AIGCBaseOnPromote(aigc AIGC) (resp bus_response.AIGCEtaResponse, err error)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if gcResp.Code == 404 {
|
|
if gcResp.Code == 404 {
|
|
- response, httpErr = llmService.FileChat(aigc.Promote, kbId, nil)
|
|
|
|
|
|
+ _, httpErr = llmService.UploadFileToTemplate([]*os.File{file}, map[string]interface{}{
|
|
|
|
+ "PrevId": kbId,
|
|
|
|
+ })
|
|
|
|
+ if httpErr != nil {
|
|
|
|
+ utils.FileLog.Error("上传文件失败,err:", err.Error())
|
|
|
|
+ err = fmt.Errorf("上传文件失败,err:%v", httpErr)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ response, httpErr = llmService.FileChat(aigc.Promote, kbId, aigc.LLMModel, nil)
|
|
if httpErr != nil {
|
|
if httpErr != nil {
|
|
utils.FileLog.Error("内容生成失败,err:%v", httpErr.Error())
|
|
utils.FileLog.Error("内容生成失败,err:%v", httpErr.Error())
|
|
err = fmt.Errorf("内容生成失败,err:%v", httpErr)
|
|
err = fmt.Errorf("内容生成失败,err:%v", httpErr)
|
|
@@ -164,6 +172,7 @@ type LLMKnowledgeSearch struct {
|
|
type AIGC struct {
|
|
type AIGC struct {
|
|
Promote string
|
|
Promote string
|
|
ArticleId int
|
|
ArticleId int
|
|
|
|
+ LLMModel string
|
|
}
|
|
}
|
|
|
|
|
|
func dealFileChatResp(response eta_llm_http.BaseResponse) (httpResponse bus_response.FileChatBaseResponse, err error) {
|
|
func dealFileChatResp(response eta_llm_http.BaseResponse) (httpResponse bus_response.FileChatBaseResponse, err error) {
|