Skip to content

Commit

Permalink
update the search
Browse files Browse the repository at this point in the history
  • Loading branch information
madneal committed Feb 12, 2025
1 parent dffce1a commit 466be3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions server/api/search_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ func StartAITask(c *gin.Context) {
for _, textMatch := range textMatches {
content += *textMatch.Fragment + "\n"
}
question := "please judge if the below content contains sensitive information, and the sensitive information " +
"could be exploited. Just answer yes or no.\n" + content
ans := service.Question("You are a security operation engineer, you are expected to assistant",
question)
global.GVA_LOG.Info(question)
ans := service.Question("You are a security operation engineer, you are expected to assistant."+
"please judge if the below content contains sensitive information, "+
"and the sensitive information could be exploited. Just answer yes or no.",
content)
global.GVA_LOG.Info(content)
global.GVA_LOG.Info(ans)
if ans == "yes" {
if strings.ToLower(ans) == "yes" {
service.UpdateSearchResultById(int(result.ID), 1)
} else {
service.UpdateSearchResultById(int(result.ID), 2)
Expand Down
5 changes: 2 additions & 3 deletions server/service/ai_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
)

func TestQuestion(t *testing.T) {
result := Question("You are a helpful assistant",
"请编写一个Python函数 find_prime_numbers,该函数接受一个整数 n 作为参数,"+
"并返回一个包含所有小于 n 的质数(素数)的列表。质数是指仅能被1和其自身整除的正整数,如2, 3, 5, 7等。不要输出非代码的内容。")
result := Question("You are a security operation engineer, you are expected to assistant.please judge if the below content contains sensitive information, and the sensitive information \" +\n\t\t\t\t\"could be exploited. Just answer yes or no.",
"# PopWin_MeiTuan\n仿美团做的一个下拉选择页,类似于电商app中筛选距离的下拉菜单。很常见。\n#效果图\n![](https://github.com/reallin/PopWin_MeiTuan/blob/master/cam.gif)\n#功能点\n* popwindow下拉列表\n* 加载progressBar的生成")
fmt.Println(result)
}

0 comments on commit 466be3c

Please sign in to comment.