1
0
mirror of https://github.com/fumiama/deepinfra.git synced 2026-06-12 22:40:14 +08:00

feat: add chat

This commit is contained in:
源文雨
2025-02-22 14:46:52 +09:00
parent 7c01751fe6
commit 2d458b6be9
3 changed files with 155 additions and 0 deletions

18
chat/item.go Normal file
View File

@@ -0,0 +1,18 @@
package chat
import "strings"
type item struct {
isatme bool
usr, txt string
}
func (item *item) writeToBuilder(sb *strings.Builder, atprefix, namel, namer string) {
if item.isatme {
sb.WriteString(atprefix)
}
sb.WriteString(namel)
sb.WriteString(item.usr)
sb.WriteString(namer)
sb.WriteString(item.txt)
}