chatgpt.js是一个功能强大的JavaScript库,允许使用Chatgpt DOM进行超级简单的交互。
笔记
始终导入最新版本(不建议在生产中推荐!)用https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js/chatgpt.min.js
方式替换版本的JSdelivr URL:
( async ( ) => {
await import ( 'https://cdn.jsdelivr.net/npm/@kudoai/[email protected]/dist/chatgpt.min.js' ) ;
// Your code here...
} ) ( ) ;
var xhr = new XMLHttpRequest ( ) ;
xhr . open ( 'GET' , 'https://cdn.jsdelivr.net/npm/@kudoai/[email protected]/dist/chatgpt.min.js' ) ;
xhr . onload = function ( ) {
if ( xhr . status === 200 ) {
var chatgptJS = document . createElement ( 'script' ) ;
chatgptJS . textContent = xhr . responseText ;
document . head . append ( chatgptJS ) ;
yourCode ( ) ; // runs your code
}
} ;
xhr . send ( ) ;
function yourCode ( ) {
// Your code here...
}
笔记
要使用入门模板:kudoai/chatgpt.js-greasemonkey-starter
...
// @require https://cdn.jsdelivr.net/npm/@kudoai/[email protected]/dist/chatgpt.min.js
// ==/UserScript==
// Your code here...
笔记
要使用入门模板:kudoai/chatgpt.js-chrome-starter
由于Google不允许远程代码,因此需要在本地导入chatgpt.js:
保存https://raw.githubusercontent.com/kudoai/chatgpt.js/main/chatgpt.js到子目录(此示例lib
)
在项目(v3) manifest.json
中,添加lib/chatgpt.js
作为网络访问资源
"web_accessible_resources" : [{
"matches" : [ " <all_urls> " ],
"resources" : [ " lib/chatgpt.js " ]
}],
chatgpt.js
(前景/背景)的脚本中,类似地导入它: ( async ( ) => {
await import ( chrome . runtime . getURL ( 'lib/chatgpt.js' ) ) ;
// Your code here...
} ) ( ) ;
要下载用于本地自定义的ChatGpt.js ,请在项目的根部运行以下命令:
npm install @kudoai/chatgpt.js
安装后,导航到node_modules/@kudoai/chatgpt.js
查找库来源。
chatgpt.js撰写了带有超灵活性的书写。
例如:
chatgpt . getLastResponse ( ) ;
chatgpt . getLastReply ( ) ;
chatgpt . response . getLast ( ) ;
chatgpt . get ( 'reply' , 'last' ) ;
每个呼叫都同样获得最后一个响应。如果您认为它有效,它可能会...所以键入它!
如果没有,请查看扩展的USERGUIDE,或者简单地提交问题或PR,然后将其集成,EZPZ!
将AI添加到亚马逊购物中。
安装 /读书 /讨论
自动清除您的Chatgpt查询历史记录,以获得最大的隐私。
安装 /读书 /讨论
添加了勇敢搜索的AI答案(由GPT-4O提供支持!)
安装 /读书 /讨论
自动继续生成多个chatgpt响应。
安装 /读书 /讨论
自动播放ChatGpt响应。
安装 /读书 /讨论
将ChatGpt会话保持新鲜,以消除网络错误 + CloudFlare检查。
安装 /读书 /讨论
为DuckDuckgo添加了AI答案(由GPT-4O提供支持!)
安装 /读书 /讨论
添加了Google搜索的AI答案(由Google Gemma + GPT-4O提供支持!)
安装 /读书 /讨论
即使有一个免费帐户,使用Thunderbird中的Chatgpt来增强您的电子邮件!
安装 /读取 /支持
如果您要分享w/ chatgpt.js的东西,请发送电子邮件至[email protected]或只是打开拉请请求!
该库存在得益于以下贡献者的代码,翻译,问题和想法:
发行/ USERGUIDE /讨论 /回到顶部↑