log debug llm response
This commit is contained in:
parent
e23795e51b
commit
96fea29a33
1 changed files with 17 additions and 0 deletions
|
|
@ -532,6 +532,23 @@ func (al *AgentLoop) runLLMIteration(ctx context.Context, agent *AgentInstance,
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if response != nil {
|
||||||
|
respString := func() string {
|
||||||
|
b, err := json.MarshalIndent(response, "", " ")
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Sprintf("[Error in parsing response: %v]", err)
|
||||||
|
}
|
||||||
|
return string(b)
|
||||||
|
}()
|
||||||
|
|
||||||
|
logger.DebugCF("agent", "Full LLM response",
|
||||||
|
map[string]interface{}{
|
||||||
|
"agent_id": agent.ID,
|
||||||
|
"iteration": iteration,
|
||||||
|
"content": respString,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
errMsg := strings.ToLower(err.Error())
|
errMsg := strings.ToLower(err.Error())
|
||||||
isContextError := strings.Contains(errMsg, "token") ||
|
isContextError := strings.Contains(errMsg, "token") ||
|
||||||
strings.Contains(errMsg, "context") ||
|
strings.Contains(errMsg, "context") ||
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue