webtools

package
v0.1.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWebFetchExecutor

func NewWebFetchExecutor() tools.Executor

func NewWebFetchExecutorWithService

func NewWebFetchExecutorWithService(web *WebService) tools.Executor

func NewWebResearchExecutors

func NewWebResearchExecutors(engine *webresearch.Engine) []tools.Executor

func NewWebResearchExecutorsWithService

func NewWebResearchExecutorsWithService(web *WebService) []tools.Executor

func NewWebSearchExecutor

func NewWebSearchExecutor(config func() (WebSearchProviderConfig, error)) tools.Executor

func NewWebSearchExecutorWithService

func NewWebSearchExecutorWithService(web *WebService) tools.Executor

Types

type WebFetchParams

type WebFetchParams struct {
	URL       string `json:"url"`
	Task      string `json:"task,omitempty"`
	MaxLength int    `json:"max_length,omitempty"`
}

type WebFetchResponseMetadata

type WebFetchResponseMetadata struct {
	URL         string   `json:"url"`
	Title       string   `json:"title,omitempty"`
	StatusCode  int      `json:"status_code,omitempty"`
	ContentType string   `json:"content_type,omitempty"`
	Truncated   bool     `json:"truncated,omitempty"`
	CharCount   int      `json:"char_count,omitempty"`
	ResearchID  string   `json:"research_id,omitempty"`
	ArtifactIDs []string `json:"artifact_ids,omitempty"`
}

type WebFetchedPage

type WebFetchedPage struct {
	URL         string `json:"url"`
	Title       string `json:"title,omitempty"`
	Text        string `json:"text,omitempty"`
	HTML        string `json:"html,omitempty"`
	StatusCode  int    `json:"status_code,omitempty"`
	ContentType string `json:"content_type,omitempty"`
	Truncated   bool   `json:"truncated,omitempty"`
}

func FetchWebPage

func FetchWebPage(ctx context.Context, rawURL string, maxLength int) (WebFetchedPage, error)

type WebSearchParams

type WebSearchParams struct {
	Query string `json:"query"`
	Limit int    `json:"limit,omitempty"`
}

type WebSearchProviderConfig

type WebSearchProviderConfig struct {
	Provider  string
	TavilyKey string
	SerperKey string
	BaseURL   string
}

WebSearchProviderConfig holds the active provider credentials for web search.

type WebSearchResponseMetadata

type WebSearchResponseMetadata struct {
	Query    string            `json:"query"`
	Provider string            `json:"provider"`
	Results  []WebSearchResult `json:"results"`
}

type WebSearchResult

type WebSearchResult struct {
	Position    int    `json:"position"`
	Title       string `json:"title"`
	URL         string `json:"url"`
	Description string `json:"description,omitempty"`
}

func RunWebSearch

func RunWebSearch(ctx context.Context, query string, limit int, cfg WebSearchProviderConfig) ([]WebSearchResult, string, error)

type WebService

type WebService struct {
	// contains filtered or unexported fields
}

func NewWebService

func NewWebService(config func() (WebSearchProviderConfig, error), engine *webresearch.Engine) *WebService

func (*WebService) Ask

func (*WebService) Research

func (*WebService) ResearchConfigured

func (s *WebService) ResearchConfigured() bool

func (*WebService) Search

func (s *WebService) Search(ctx context.Context, query string, limit int) ([]WebSearchResult, string, error)

func (*WebService) Status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL