Documentation
¶
Index ¶
Constants ¶
View Source
const ( // BrowseToolName 网页浏览工具名 BrowseToolName = "WebBrowse" // FetchToolName 网页内容获取工具名 FetchToolName = "WebFetch" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrowseInput ¶
type BrowseInput struct {
// 需要浏览的 URL
URL string `json:"url"`
// 浏览网页时希望解答的问题
Question string `json:"question,omitempty"`
// 超时时间(秒),默认 60
Timeout int `json:"timeout,omitempty"`
}
BrowseInput 网页浏览输入
type BrowseOutput ¶
type BrowseOutput struct {
// 网页文本内容
Text string `json:"text,omitempty"`
// 对问题的回答
Answer string `json:"answer,omitempty"`
}
BrowseOutput 网页浏览输出
type FetchOutput ¶
FetchOutput 获取 URL 内容输出
type WebBrowser ¶
type WebBrowser struct {
// contains filtered or unexported fields
}
WebBrowser 网页浏览工具
支持 JS 运行、页面渲染,通过视觉模型读取网页内容。依赖 Chrome 和视觉模型
func (*WebBrowser) DefineBrowseTool ¶
func (wb *WebBrowser) DefineBrowseTool(g *genkit.Genkit) ai.ToolRef
DefineBrowseTool 定义浏览网页工具
func (*WebBrowser) DefineFetchTool ¶
func (wb *WebBrowser) DefineFetchTool(g *genkit.Genkit) ai.ToolRef
DefineFetchTool 定义获取 URL 内容工具
func (*WebBrowser) RegisterTools ¶
func (wb *WebBrowser) RegisterTools(g *genkit.Genkit) []ai.ToolRef
RegisterTools 注册工具
Click to show internal directories.
Click to hide internal directories.