836de5b597
Fetch and clean each search result's page body (bounded by size, concurrency, and a configurable MaxPageContentRunes), store it on the new ResearchResult.Content field, and surface those excerpts in agent memory so the model reasons over real page text rather than snippets alone. Promotes golang.org/x/net to a direct dependency for HTML parsing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
23 lines
551 B
Go
23 lines
551 B
Go
package design
|
|
|
|
import "context"
|
|
|
|
type ResearchResult struct {
|
|
Title string `json:"title"`
|
|
URL string `json:"url"`
|
|
Snippet string `json:"snippet"`
|
|
Content string `json:"content,omitempty"`
|
|
}
|
|
|
|
type ResearchReport struct {
|
|
Kind string `json:"kind"`
|
|
Source string `json:"source"`
|
|
Query string `json:"query"`
|
|
Results []ResearchResult `json:"results"`
|
|
Error string `json:"error,omitempty"`
|
|
}
|
|
|
|
type Researcher interface {
|
|
Research(ctx context.Context, prompt string) (ResearchReport, error)
|
|
}
|