mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
This commit is contained in:
parent
ba400854b0
commit
69c18db9ed
4 changed files with 81 additions and 9 deletions
|
|
@ -54,3 +54,38 @@ func chatGPTContinueWriteBlocks(c *gin.Context) {
|
|||
}
|
||||
ret.Data = model.ChatGPTContinueWriteBlocks(ids)
|
||||
}
|
||||
|
||||
func chatGPTTranslate(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
idsArg := arg["ids"].([]interface{})
|
||||
var ids []string
|
||||
for _, id := range idsArg {
|
||||
ids = append(ids, id.(string))
|
||||
}
|
||||
lang := arg["lang"].(string)
|
||||
ret.Data = model.ChatGPTTranslate(ids, lang)
|
||||
}
|
||||
|
||||
func chatGPTSummary(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
idsArg := arg["ids"].([]interface{})
|
||||
var ids []string
|
||||
for _, id := range idsArg {
|
||||
ids = append(ids, id.(string))
|
||||
}
|
||||
ret.Data = model.ChatGPTSummary(ids)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue