Documentation
¶
Index ¶
Constants ¶
View Source
const ( SearchToolName = "WebSearch" SearchDesc = `` /* 140-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SearchInput ¶
type SearchInput struct {
// 查询关键词
Query string `json:"query"`
}
SearchInput 网络搜索输入
type SearchOutput ¶
type SearchOutput struct {
Items []SearchResultItem `json:"items"`
}
SearchOutput 网络搜索输出
type SearchResultItem ¶
type SearchResultItem struct {
// 标题
Title string `json:"title"`
// 简介
Description string `json:"description"`
// 发布日期
Date time.Time `json:"date,omitempty"`
// 网站 URL
URL string `json:"url"`
// 所属网站
Site string `json:"site,omitempty"`
}
SearchResultItem 搜索结果项
type SearchTool ¶
type SearchTool = *ai.ToolDef[SearchInput, SearchOutput]
SearchTool 网络搜索工具
func DefineTencentCloudWSASearchTool ¶
func DefineTencentCloudWSASearchTool( g *genkit.Genkit, client *wsa.Client, ) SearchTool
DefineTencentCloudWSASearchTool 定义腾讯云 WSA 搜索工具
type TencentCloudWSAOptions ¶
type TencentCloudWSAOptions struct {
Endpoint string `json:"endpoint,omitempty"`
SecretID string `json:"secretID"`
SecretKey string `json:"secretKey"`
}
TencentCloudWSAOptions 腾讯云 WSA 选项
func (*TencentCloudWSAOptions) RegisterTool ¶
func (opts *TencentCloudWSAOptions) RegisterTool(_ context.Context, g *genkit.Genkit) (SearchTool, error)
RegisterTool 注册工具
Click to show internal directories.
Click to hide internal directories.