Enable more logging, only describe image once when walking history

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2025-03-09 18:50:50 +01:00
committed by Ettore Di Giacinto
parent 28e80084f6
commit bc60dde94f
2 changed files with 15 additions and 2 deletions

View File

@@ -150,6 +150,14 @@ func (m Messages) GetLatestUserMessage() *openai.ChatCompletionMessage {
return nil
}
func (m Messages) IsLastMessageFromRole(role string) bool {
if len(m) == 0 {
return false
}
return m[len(m)-1].Role == role
}
func (a *Agent) generateParameters(ctx context.Context, pickTemplate string, act Action, c []openai.ChatCompletionMessage, reasoning string) (*decisionResult, error) {
stateHUD, err := renderTemplate(pickTemplate, a.prepareHUD(), a.systemInternalActions(), reasoning)