human print the gemini struct
This commit is contained in:
parent
0bf0fe3b01
commit
1aaa1d0e07
|
@ -107,3 +107,50 @@ func (c *Chat) PrintChatGeminiTable() {
|
|||
}
|
||||
log.Infof("Total Chats: %d\n", len(c.GetEntries()))
|
||||
}
|
||||
|
||||
func (gr *GeminiRequest) PrintGeminiTable() {
|
||||
if gr == nil {
|
||||
return
|
||||
}
|
||||
log.DaemonMode(true)
|
||||
|
||||
// print the header
|
||||
args := []string{"model", "what", "age", "cId", "partId", "", "", "", "", ""}
|
||||
sizes := []int{16, 8, 4, 4, 4, 16, 120, 2, 2, 2}
|
||||
log.Info(cobol.StandardTableSize10(sizes, args))
|
||||
|
||||
var countCONTENTS int
|
||||
var countPARTS int
|
||||
for x, c := range gr.GetContents() {
|
||||
model := gr.Model
|
||||
cId := log.Sprintf("%d", x)
|
||||
countCONTENTS += 1
|
||||
for i, p := range c.GetParts() {
|
||||
var args []string
|
||||
partId := log.Sprintf("%d", i)
|
||||
|
||||
// removes newline chars from the text
|
||||
parts := strings.Split(p.GetText(), "\n")
|
||||
txt := strings.Join(parts, "__")
|
||||
|
||||
what := "TXT"
|
||||
|
||||
if fc := p.GetFunctionCall(); fc != nil {
|
||||
what = "FuncCall"
|
||||
txt = log.Sprintf("%s, %v", fc.Name, fc.Args)
|
||||
|
||||
}
|
||||
if fr := p.GetFunctionResponse(); fr != nil {
|
||||
what = "FuncResp"
|
||||
txt = fr.Name
|
||||
}
|
||||
|
||||
args = []string{model, what, "", cId, partId, p.ThoughtSignature, txt, "", "", ""}
|
||||
|
||||
start := cobol.StandardTableSize10(sizes, args)
|
||||
log.Info(start)
|
||||
countPARTS += 1
|
||||
}
|
||||
}
|
||||
log.Infof("Total Contents (%d) Parts (%d)\n", countCONTENTS, countPARTS)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue