Skip to content

Commit

Permalink
fix: 修复Prompt的错误,同时汉化
Browse files Browse the repository at this point in the history
  • Loading branch information
liuhuapiaoyuan committed Jan 6, 2024
1 parent d397396 commit 7b63e30
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend-api/backend-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func init() {
// backendGroup.GET("/accounts/check/*any", accounts.Check)
backendGroup.GET("/me", Me)
backendGroup.GET("/conversations", Conversations)
backendGroup.GET("/prompt_library", Prompt_library)

}

Expand Down
44 changes: 44 additions & 0 deletions backend-api/prompt_library.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package backendapi

import (
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/net/ghttp"
)

func Prompt_library(r *ghttp.Request) {

resJson := gjson.New(`
{
"items": [
{
"id": "195cfe2a",
"title": "构思概念",
"description": "一个复古风格的街机游戏",
"prompt": "为一个复古风格的街机游戏构思5个概念。"
},
{
"id": "c25a3687",
"title": "展示一个网站粘性导航的代码片段",
"description": "使用CSS和JavaScript展示一个网站的粘性导航的代码片段",
"prompt": "展示一个网站的粘性导航的CSS和JavaScript代码片段。"
},
{
"id": "9fa376de",
"title": "推荐一道菜",
"description": "以迎合挑食的约会对象",
"prompt": "我要为一个自称挑食的约会对象烹饪。你能推荐一道易于做的菜吗?"
},
{
"id": "b1935e1a",
"title": "解释这段代码:",
"description": "\"cat config.yaml | awk NF\"",
"prompt": "解释这个bash命令的作用:\"cat config.yaml | awk NF\""
}
],
"total": 4,
"limit": 4,
"offset": 0
}
`)
r.Response.WriteJson(resJson)
}

0 comments on commit 7b63e30

Please sign in to comment.