Skip to content

Commit

Permalink
Beta67 (#69)
Browse files Browse the repository at this point in the history
* beta1

* beta2

* beta3

* beta4

* beta5

* beta6

* beta7

* beta8

* beta9

* beta10

* beta11

* beta12

* beta13

* beta14

* beta15

* beta16

* beta16

* beta19

* beta20

* beta21

* beta22

* beta23

* beta24

* beta25

* beta27

* beta28

* beta29

* beta30

* beta31

* beta33

* beta34

* beta35

* beta36

* beta37

* beta38

* beta39

* beta40

* beta41

* beta42

* beta43

* beta44

* beta45

* beta45

* beta46

* beat48

* beta49

* beta50

* beta51

* beta52

* beta53

* beta54

* beta55

* beta57

* beta58

* beta59

* beta61

* beta62

* beta63

* beta63

* beta64

* beta65

* beta66

* beta67
  • Loading branch information
Hoshinonyaruko authored Apr 17, 2024
1 parent 8ff8ea2 commit 3232fd8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
8 changes: 6 additions & 2 deletions applogic/gensokyo.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ func (app *App) GensokyoHandler(w http.ResponseWriter, r *http.Request) {
}

// 处理接收到的数据
fmtf.Printf("Received SSE data: %s", string(line))
if !config.GetHideExtraLogs() {
fmtf.Printf("Received SSE data: %s", string(line))
}

// 去除"data: "前缀后进行JSON解析
jsonData := strings.TrimPrefix(string(line), "data: ")
Expand Down Expand Up @@ -485,7 +487,9 @@ func (app *App) GensokyoHandler(w http.ResponseWriter, r *http.Request) {
}
} else {
//发送信息
fmtf.Printf("收到流数据,切割并发送信息: %s", string(line))
if !config.GetHideExtraLogs() {
fmtf.Printf("收到流数据,切割并发送信息: %s", string(line))
}
splitAndSendMessages(message, string(line), newmsg)
}
}
Expand Down
11 changes: 11 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ type Settings struct {
RwkvSystemName string `yaml:"rwkvSystemName"`
RwkvPreSystem bool `yaml:"rwkvPreSystem"`
RwkvSseType int `yaml:"rwkvSseType"`
HideExtraLogs bool `yaml:"hideExtraLogs"`
}

// LoadConfig 从文件中加载配置并初始化单例配置
Expand Down Expand Up @@ -1130,3 +1131,13 @@ func GetRwkvPreSystem() bool {
}
return false
}

// 获取隐藏日志
func GetHideExtraLogs() bool {
mu.Lock()
defer mu.Unlock()
if instance != nil {
return instance.Settings.HideExtraLogs
}
return false
}
3 changes: 2 additions & 1 deletion template/config_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ settings:
promptkeyboard : [""] #临时的promptkeyboard超过3个则随机,后期会增加一个ai生成的方式,也会是ai-agent
savelogs : false #本地落地日志.
noContext : false #不开启上下文
withdrawCommand : ["撤回"] #撤回指令
withdrawCommand : ["撤回"] #撤回指令
hideExtraLogs : false #忽略流信息的log,提高性能
functionMode : false #是否指定本agent使用func模式(目前仅支持千帆平台),效果不好,暂时不用.
functionPath : "" #调用另一个启用了func模式的gsk-llm联合工作的/conversation地址,效果不好,暂时不用.
Expand Down

0 comments on commit 3232fd8

Please sign in to comment.