websearch

package
v0.0.0-...-0f488bb Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package websearch 基于 You.com Search API 实现联网检索能力, 作为 eino retriever.Retriever 的一种实现,独立于现有的向量检索链路。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey     string // You.com Search API Key,留空时读取环境变量 YDC_API_KEY
	BaseURL    string // 可选,默认 https://ydc-index.io/v1/search
	Count      int    // 默认返回结果数量,默认 5,最大 20
	TimeoutSec int    // 请求超时时间(秒),默认 10
}

Config You.com 联网检索配置

type YouComRetriever

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

YouComRetriever 基于 You.com Search API 实现的 eino Retriever

func NewRetriever

func NewRetriever(cfg *Config) (*YouComRetriever, error)

NewRetriever 创建 You.com 联网检索 retriever

func (*YouComRetriever) Retrieve

func (r *YouComRetriever) Retrieve(ctx context.Context, query string, opts ...retriever.Option) ([]*schema.Document, error)

Retrieve 调用 You.com Search API 检索网页结果,实现 eino retriever.Retriever 接口

Jump to

Keyboard shortcuts

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