@gui-chat-plugin/浏览
GUI Chat 应用程序的网页浏览插件. 浏览并从网页取出内容.
特征
- 从任何网页 URL 提取内容
- Twitter/X 站点嵌入支持
- 条款内容解析(标题,下行,摘录,正文)
- 清洁、可读内容显示
安装
yarn add @gui-chat-plugin/browse gui-chat-protocol
gui-chat-protocol是一个对等的依赖性——与插件一起安装;主机应用程序提供运行时间,这个插件只宣布相容范围.
使用量
Vue 整合
// In src/tools/index.ts
import BrowsePlugin from "@gui-chat-plugin/browse/vue";
const pluginList = [
// ... other plugins
BrowsePlugin,
];
// In src/main.ts
import "@gui-chat-plugin/browse/style.css";
仅使用核心
import { executeBrowse, TOOL_DEFINITION } from "@gui-chat-plugin/browse";
// Browse a webpage
const result = await executeBrowse(context, {
url: "https://example.com/article",
});
API 密码
浏览Args
interface BrowseArgs {
url: string; // The URL of the webpage to browse
}
浏览工具Data
interface BrowseToolData {
url: string;
twitterEmbedHtml?: string | null;
}
浏览 JsonData
interface BrowseJsonData {
data: {
title?: string;
description?: string;
content?: string;
textContent?: string;
text?: string;
byline?: string;
excerpt?: string;
};
}
发展
# Install dependencies
yarn install
# Run demo
yarn dev
# Build
yarn build
# Lint
yarn lint
测试提示
尝试这些提示测试插件 :
- "浏览维基百科关于人工智能的页面 告诉我要点"
- "给我看看黑客新闻主页上的内容"
- "读了这篇文章并总结:https://example.com/article"
许可证
麻省理工学院
相关
- 协议规格 : gui-chat-protocol (英语)
- 使用本协议的参考执行: 穆尔莫克 • 妇女 穆尔莫聊天