Skip to content

Commit

Permalink
improve ai analysis
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zhao <[email protected]>
  • Loading branch information
PetrusZ committed Feb 14, 2025
1 parent e47982d commit 14c03ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/microservice/aslan/core/stat/service/ai/ai_analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func AnalyzeProjectStats(args *AiAnalysisReq, logger *zap.SugaredLogger) (*AiAna
// the design of the prompt directly determines the quality of the answer
if tokenNum > AnalysisModelTokenLimit {
prompt = fmt.Sprintf("假设你是Devops专家,需要你根据分析要求分析三重引号分割的项目数据,该数据是多个项目各自的初步分析结果,"+
"分析要求:%s;你的回答需要使用text格式输出,输出内容不要包含\"三重引号分割的项目数据\"这个名称,也不要复述分析要求中的内容,在你的回答中禁止包含 "+
"分析要求:%s;你的回答需要使用markdown格式输出,输出内容不要包含\"三重引号分割的项目数据\"这个名称,也不要复述分析要求中的内容,在你的回答中禁止包含 "+
"\\\"data_description\\\"\\\"jenkins\\\" 等字段; 项目数据:\"\"\"%s\"\"\"", args.Prompt, overAllInput)
}
options := []llm.ParamOption{llm.WithTemperature(float32(0.2))}
Expand Down Expand Up @@ -142,7 +142,7 @@ func AnalyzeProject(userPrompt string, project *ProjectData, client llm.ILLM, an
return
}

prompt := fmt.Sprintf("假设你是资深Devops专家,我需要你根据以下分析要求来分析用三重引号分割的项目数据,最后根据你的分析来生成分析报告,分析要求:%s; 项目数据:\"\"\"%s\"\"\";你的回答不能超过400个汉字,同时回答内容要符合text格式,不要存在换行和空行;", util.RemoveExtraSpaces(EveryProjectAnalysisPrompt), string(pData))
prompt := fmt.Sprintf("假设你是资深Devops专家,我需要你根据以下分析要求来分析用三重引号分割的项目数据,最后根据你的分析来生成分析报告,分析要求:%s; 项目数据:\"\"\"%s\"\"\";你的回答不能超过400个汉字,同时回答内容要符合markdown格式,不要存在换行和空行;", util.RemoveExtraSpaces(EveryProjectAnalysisPrompt), string(pData))
options := []llm.ParamOption{llm.WithTemperature(float32(0.1))}
if client.GetModel() != "" {
options = append(options, llm.WithModel(client.GetModel()))
Expand Down

0 comments on commit 14c03ee

Please sign in to comment.