feat: add history metadata of agent browser (#71)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto
2025-04-21 22:52:04 +02:00
committed by GitHub
parent bafd26e92c
commit ee1667d51a
2 changed files with 4 additions and 1 deletions

View File

@@ -33,6 +33,8 @@ type StateDescription struct {
CurrentURL string `json:"current_url"` CurrentURL string `json:"current_url"`
PageTitle string `json:"page_title"` PageTitle string `json:"page_title"`
PageContentDescription string `json:"page_content_description"` PageContentDescription string `json:"page_content_description"`
Screenshot string `json:"screenshot"`
ScreenshotMimeType string `json:"screenshot_mime_type"` // MIME type of the screenshot (e.g., "image/png")
} }
// StateHistory represents the complete history of states during agent execution // StateHistory represents the complete history of states during agent execution

View File

@@ -62,6 +62,7 @@ func (b *BrowserAgentRunner) Run(ctx context.Context, params types.ActionParams)
return types.ActionResult{ return types.ActionResult{
Result: fmt.Sprintf("Browser agent completed successfully. History:\n%s", historyStr), Result: fmt.Sprintf("Browser agent completed successfully. History:\n%s", historyStr),
Metadata: map[string]interface{}{"browser_agent_history": stateHistory},
}, nil }, nil
} }