INNER CODE UNIT · Go
configOpts
teilomillet/gollm · cmd/gollm/main.go:125
configOpts = append(configOpts, gollm.SetLogLevel(gollm.LogLevel(getLogLevel(*debugLevel))))
return configOpts
}
func printResponse(verbose bool, promptType, fullPrompt, rawPrompt, response, outputFormat string) {
if verbose {
if fullPrompt == "" {
fullPrompt = rawPrompt // For qa, cot, and summarize, we don't have access to the full prompt
}
fmt.Printf("Prompt Type: %s\nFull Prompt:\n%s\n\nResponse:\n---------\n", promptType, fullPrompt)
}
if outputFormat == "json" {
var jsonResponse interface{}
err := json.Unmarshal([]byte(response), &jsonResponse)
if err != nil {
fmt.Fprintf(os.Stderr, "Error parsing JSON response: %v\n", err)