diff options
| author | Jeff Carr <[email protected]> | 2025-09-02 18:37:23 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-02 18:37:23 -0500 | 
| commit | 1aaa1d0e0743acc62b41e65b7547a53de5a399bf (patch) | |
| tree | 13fbe25ba70ddf835cbf3c15a1fee805b6b39a92 | |
| parent | 0bf0fe3b01dfeafb38c25e4f25f631833df97c51 (diff) | |
human print the gemini struct
| -rw-r--r-- | humanTable.go | 47 | 
1 files changed, 47 insertions, 0 deletions
diff --git a/humanTable.go b/humanTable.go index b134efb..d77bc01 100644 --- a/humanTable.go +++ b/humanTable.go @@ -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) +}  | 
