websearch

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 5 Imported by: ? 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 Register

func Register(p Provider)

Register search providers

Types

type ExtractInput

type ExtractInput struct {
	Url string `json:"url" jsonschema:"the url the web page to extract content from"`
}

type ExtractReply

type ExtractReply struct {
	Content string `json:"content" jsonschema:"the content extracted from the web page"`
}

type Extractor

type Extractor interface {
	Extracts(ctx context.Context, req *mcp.CallToolRequest, input ExtractInput) (*mcp.CallToolResult, ExtractReply, error)
}

type Provider

type Provider interface {
	ID() string
	Close() error
}

type SearchInput

type SearchInput struct {
	Query   string   `json:"query" jsonschema:"the query to search for"`
	Hashtag []string `json:"hashtag,omitempty" jsonschema:"hashtag to scope search results"`
	Sort    Sort     `json:"sort,omitempty" jsonschema:"the sort order of the search results, 'relevance' or 'date'"`
}

type SearchReply

type SearchReply struct {
	Facts []websearch.Fact `json:"facts" jsonschema:"the facts to return to the client"`
}

type Searcher

type Searcher interface {
	Search(ctx context.Context, req *mcp.CallToolRequest, input SearchInput) (*mcp.CallToolResult, SearchReply, error)
}

type Server

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

func Must added in v0.0.7

func Must(id string) *Server

func New

func New(id string) (server *Server, err error)

func (*Server) Close

func (srv *Server) Close() error

func (*Server) Extracts

func (*Server) Run

func (srv *Server) Run(ctx context.Context) error

func (*Server) Search

type Sort

type Sort string
const (
	SortRelevance Sort = "relevance"
	SortDate      Sort = "date"
)

Jump to

Keyboard shortcuts

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