Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta75 #74

Merged
merged 76 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
ea4bcc6
beta1
Hoshinonyaruko Jan 21, 2024
5002a28
beta2
Hoshinonyaruko Jan 21, 2024
969841e
beta3
Hoshinonyaruko Jan 21, 2024
a2989c2
beta4
Hoshinonyaruko Jan 21, 2024
611cd8b
beta5
Hoshinonyaruko Jan 21, 2024
dbad42b
beta6
Hoshinonyaruko Jan 21, 2024
4f8895e
beta7
Hoshinonyaruko Jan 21, 2024
30a9cab
beta8
Hoshinonyaruko Jan 21, 2024
461d879
beta9
Hoshinonyaruko Jan 21, 2024
c90c2ee
beta10
Hoshinonyaruko Jan 21, 2024
5227c32
beta11
Hoshinonyaruko Jan 21, 2024
8e14e56
beta12
Hoshinonyaruko Jan 21, 2024
6adfb7f
beta13
Hoshinonyaruko Jan 21, 2024
b04f6c0
beta14
Hoshinonyaruko Jan 21, 2024
649e740
beta15
Hoshinonyaruko Jan 21, 2024
d55cf29
beta16
Hoshinonyaruko Jan 21, 2024
1cc351e
beta16
Hoshinonyaruko Jan 21, 2024
f1a373e
beta19
Hoshinonyaruko Jan 21, 2024
cbf2fe1
beta20
Hoshinonyaruko Jan 21, 2024
3485bfc
beta21
Hoshinonyaruko Jan 21, 2024
3e3bb1a
beta22
Hoshinonyaruko Jan 21, 2024
2e4f3fa
beta23
Hoshinonyaruko Mar 29, 2024
f74075d
beta24
Hoshinonyaruko Mar 29, 2024
f3913cf
beta25
Hoshinonyaruko Mar 29, 2024
4cfb51a
beta27
Hoshinonyaruko Mar 30, 2024
d9b26c0
beta28
Hoshinonyaruko Mar 31, 2024
19da709
beta29
Hoshinonyaruko Mar 31, 2024
e06dcbf
merge
Hoshinonyaruko Mar 31, 2024
c76923e
beta30
Hoshinonyaruko Mar 31, 2024
9ae21da
beta31
Hoshinonyaruko Apr 1, 2024
4f333bc
merge
Hoshinonyaruko Apr 1, 2024
5acba8f
beta33
Hoshinonyaruko Apr 1, 2024
c637fcd
beta34
Hoshinonyaruko Apr 1, 2024
4e85b37
beta35
Hoshinonyaruko Apr 1, 2024
970948e
beta36
Hoshinonyaruko Apr 1, 2024
14271c3
beta37
Hoshinonyaruko Apr 1, 2024
6154d1a
beta38
Hoshinonyaruko Apr 1, 2024
d5be5e6
beta39
Hoshinonyaruko Apr 3, 2024
54afe18
beta40
Hoshinonyaruko Apr 3, 2024
0b71855
beta41
Hoshinonyaruko Apr 3, 2024
8c5f9a3
merge
Hoshinonyaruko Apr 3, 2024
cf752d4
beta42
Hoshinonyaruko Apr 3, 2024
3698824
beta43
Hoshinonyaruko Apr 3, 2024
1e9c189
beta44
Hoshinonyaruko Apr 3, 2024
2adb4ac
beta45
Hoshinonyaruko Apr 4, 2024
79eb713
beta45
Hoshinonyaruko Apr 4, 2024
064f0d0
beta45
Hoshinonyaruko Apr 4, 2024
5a4a59e
beta46
Hoshinonyaruko Apr 5, 2024
df30a32
beta46
Hoshinonyaruko Apr 5, 2024
c920893
beat48
Hoshinonyaruko Apr 7, 2024
3491d5d
beta49
Hoshinonyaruko Apr 8, 2024
575b2ca
beta50
Hoshinonyaruko Apr 8, 2024
4c4bbaa
beta51
Hoshinonyaruko Apr 8, 2024
2ea728b
beta52
Hoshinonyaruko Apr 8, 2024
82bf952
beta53
Hoshinonyaruko Apr 8, 2024
869685c
beta54
Hoshinonyaruko Apr 9, 2024
1f3646e
beta55
Hoshinonyaruko Apr 9, 2024
d6bbadf
beta57
Hoshinonyaruko Apr 10, 2024
fc5086c
beta58
Hoshinonyaruko Apr 10, 2024
602ff65
beta59
Hoshinonyaruko Apr 10, 2024
a82538d
Merge branch 'main' of https://github.com/Hoshinonyaruko/Gensokyo-llm…
Hoshinonyaruko Apr 10, 2024
6433600
beta61
Hoshinonyaruko Apr 10, 2024
9ce88b3
beta62
Hoshinonyaruko Apr 12, 2024
b53617b
beta63
Hoshinonyaruko Apr 12, 2024
ff64c69
beta63
Hoshinonyaruko Apr 12, 2024
b34885f
beta64
Hoshinonyaruko Apr 13, 2024
3658648
beta65
Hoshinonyaruko Apr 13, 2024
3307439
beta66
Hoshinonyaruko Apr 15, 2024
f15c422
beta67
Hoshinonyaruko Apr 17, 2024
518de35
beta70
Hoshinonyaruko Apr 18, 2024
a65f07d
beta71
Hoshinonyaruko Apr 18, 2024
59d07c7
beta72
Hoshinonyaruko Apr 18, 2024
a16ea64
beta72
Hoshinonyaruko Apr 18, 2024
08d5864
beta74
Hoshinonyaruko Apr 19, 2024
9b09401
beta75
Hoshinonyaruko Apr 19, 2024
c71940d
Merge branch 'main' into beta75
Hoshinonyaruko Apr 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions utils/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ func processLogFile(filePath string) {
if strings.Contains(line, "A完整信息:") {
formatAndWriteAnswerLine(line, outputFile)
}
if strings.Contains(line, "实际发送信息:") {
formatAndWriteAnswerLineV2(line, outputFile)
}
}

if err := scanner.Err(); err != nil {
Expand Down Expand Up @@ -123,3 +126,36 @@ func formatAndWriteAnswerLine(line string, outputFile *os.File) {
}
}
}

func formatAndWriteAnswerLineV2(line string, outputFile *os.File) {
prefix := "实际发送信息:"
infoSuffix := "INFO:" // 设置截止字符串

currentIndex := 0 // 当前搜索的起始位置
for {
// 从当前索引开始查找"实际发送信息:"的开始位置
startIndex := strings.Index(line[currentIndex:], prefix)
if startIndex == -1 {
break // 如果没有找到,退出循环
}
startIndex += currentIndex // 调整到全局索引

messageStart := startIndex + len(prefix)
endIndex := strings.Index(line[messageStart:], infoSuffix) // 查找"INFO:"的开始位置
if endIndex == -1 {
break // 如果没有找到,退出循环
}
endIndex += messageStart // 调整到全局索引

message := line[messageStart:endIndex] // 截取从"实际发送信息:"到"INFO:"之前的内容
formattedLine := fmt.Sprintf("实际发送:%s\n", strings.TrimSpace(message)) // 格式化并去除前后空白字符

// 写入到输出文件
_, err := outputFile.WriteString(formattedLine)
if err != nil {
fmt.Println("Error writing to output file:", err)
}

currentIndex = endIndex // 更新currentIndex为当前endIndex,为下一次搜索做准备
}
}
4 changes: 4 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func SendGroupMessage(groupID int64, userID int64, message string, selfid string
"message": message,
})
fmtf.Printf("发群信息请求:%v", string(requestBody))
fmtf.Printf("实际发送信息:%v", message)
if err != nil {
return fmtf.Errorf("failed to marshal request body: %w", err)
}
Expand Down Expand Up @@ -280,6 +281,7 @@ func SendPrivateMessage(UserID int64, message string, selfid string) error {
if err != nil {
return fmtf.Errorf("failed to marshal request body: %w", err)
}
fmtf.Printf("实际发送信息:%v", message)

// 发送POST请求
resp, err := http.Post(u.String(), "application/json", bytes.NewBuffer(requestBody))
Expand Down Expand Up @@ -361,6 +363,8 @@ func SendPrivateMessageSSE(UserID int64, message structs.InterfaceBody) error {
return nil
}

fmtf.Printf("实际发送信息:%v", message.Content)

// 构造请求体,包括InterfaceBody
requestBody, err := json.Marshal(map[string]interface{}{
"user_id": UserID,
Expand Down
Loading