duckduckgo

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package duckduckgo contains an implementation of the tool interface with the duckduckgo api client.

Index

Constants

View Source
const DefaultUserAgent = "gitee.com/zzcadmin/langchaingo/tools/duckduckgo"

DefaultUserAgent defines a default value for user-agent header.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tool

type Tool struct {
	CallbacksHandler callbacks.Handler
	// contains filtered or unexported fields
}

Tool defines a tool implementation for the DuckDuckGo Search.

func New

func New(maxResults int, userAgent string) (*Tool, error)

New initializes a new DuckDuckGo Search tool with arguments for setting a max results per search query and a value for the user agent header.

func (Tool) Call

func (t Tool) Call(ctx context.Context, input string) (string, error)

Call performs the search and return the result.

func (Tool) Description

func (t Tool) Description() string

Description returns a description for the tool.

func (Tool) Name

func (t Tool) Name() string

Name returns a name for the tool.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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