Chore: make debug; icon fix
This commit is contained in:
7
Makefile
7
Makefile
@@ -1,8 +1,15 @@
|
|||||||
.PHONY: setconfig run lint setup-whisper build-whisper download-whisper-model docker-up docker-down docker-logs noextra-run noextra-server
|
.PHONY: setconfig run lint setup-whisper build-whisper download-whisper-model docker-up docker-down docker-logs noextra-run noextra-server
|
||||||
|
|
||||||
|
|
||||||
run: setconfig
|
run: setconfig
|
||||||
go build -tags extra -o gf-lt && ./gf-lt
|
go build -tags extra -o gf-lt && ./gf-lt
|
||||||
|
|
||||||
|
build-debug:
|
||||||
|
go build -gcflags="all=-N -l" -tags extra -o gf-lt
|
||||||
|
|
||||||
|
debug: build-debug
|
||||||
|
dlv exec --headless --accept-multiclient --listen=:2345 ./gf-lt
|
||||||
|
|
||||||
server: setconfig
|
server: setconfig
|
||||||
go build -tags extra -o gf-lt && ./gf-lt -port 3333
|
go build -tags extra -o gf-lt && ./gf-lt -port 3333
|
||||||
|
|
||||||
|
|||||||
@@ -189,9 +189,12 @@ func (m *RoleMsg) ToText(i int) string {
|
|||||||
contentStr = strings.Join(textParts, " ") + " "
|
contentStr = strings.Join(textParts, " ") + " "
|
||||||
}
|
}
|
||||||
// check if already has role annotation (/completion makes them)
|
// check if already has role annotation (/completion makes them)
|
||||||
if !strings.HasPrefix(contentStr, m.Role+":") {
|
// in that case remove it, and then add to icon
|
||||||
icon = fmt.Sprintf("(%d) <%s>: ", i, m.Role)
|
// since icon and content are separated by \n
|
||||||
}
|
contentStr, _ = strings.CutPrefix(contentStr, m.Role+":")
|
||||||
|
// if !strings.HasPrefix(contentStr, m.Role+":") {
|
||||||
|
icon = fmt.Sprintf("(%d) <%s>: ", i, m.Role)
|
||||||
|
// }
|
||||||
textMsg := fmt.Sprintf("[-:-:b]%s[-:-:-]\n%s\n", icon, contentStr)
|
textMsg := fmt.Sprintf("[-:-:b]%s[-:-:-]\n%s\n", icon, contentStr)
|
||||||
return strings.ReplaceAll(textMsg, "\n\n", "\n")
|
return strings.ReplaceAll(textMsg, "\n\n", "\n")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user