前言

Chat Nio 是一个强大且功能丰富的 AI 聚合聊天平台,支持分布式流式传输,图像生成,对话跨设备自动同步和分享功能,实现订阅和 Token 弹性计费系统,Key 中转服务,多模型聚合支持等。实现联网搜索功能,AI 卡片,AI 项目生成器等功能。之前的推文介绍请访问https://www.noiseblog.top/posts/211bad8/https://mp.weixin.qq.com/s?__biz=MzUzODgyNDc5Ng==&mid=2247486377&idx=1&sn=9948d7a5fc02c4a1c26944745c6e2cab&chksm=fad0929acda71b8cf1752bfc3e71ae3d6cbd314c5165387e31e7f40a66108c7dc867e0815d5a&token=1684731676&lang=zh_CN#rd

今天介绍的是使用chatnio的api来创建自己的免费扩展,包括chatgpt-on-wechat接入个人微信、Telegram ChatGPT bot、飞书GPT Bot、popclip扩展-AI写手、Utools扩展text ai、第三方AI客户端-chat-x、Web程序ChatGPT-Next-Web

每个项目如有开源的,部署请查看其项目地址,另外Chat Nio其实支持非常多的模型,所以在后端代码中可选择不同的模型【不一定非要gpt】

一、chatgpt-on-wechat接入个人微信、公众号等

项目地址:https://github.com/zhayujie/chatgpt-on-wechat

推荐railway一键部署,API替换:

open_ai_api_base变量处修改为https://api.chatnio.net/v1

open_ai_api_key修改为自己的Chat Nio-key【个人设置-key】

二、Telegram ChatGPT bot

项目地址:https://github.com/TBXark/ChatGPT-Telegram-Workers

中文部署说明:https://github.com/TBXark/ChatGPT-Telegram-Workers/blob/master/doc/cn/DEPLOY.md

API替换:

设置-变量中OPENAI_API_DOMAIN修改为https://api.chatnio.net

API_KEY修改为自己的Chat Nio-key【个人设置-key】

Demo:@noisechatbot

三、飞书GPT Bot

项目地址:https://github.com/bestony/ChatGPT-Feishu

API替换:

149行代码处修改url为https://api.chatnio.net/v1/chat/completions

变量KEY修改为自己的Chat Nio-key【个人设置-key】

效果:

四、popclip扩展-AI写手

这是一个和chatgpt交互的popclip扩展,通过该扩展你能轻松在mac上选中文字并即时得到内容

原文:https://noise.zhubai.love/posts/2299250733323182080

效果

已改代码:



// #popclip extension for ChatGPT
// name: smart writer
// icon: iconify:fluent:calligraphy-pen-24-regular
// language: javascript
// module: true
// entitlements: [network]
// options: [{
//   identifier: apikey, label: API Key, type: string,
//   description: 'Obtain API key from https://platform.openai.com/account/api-keys'
// }]
​
const prefixes = {
    "polish": "你是我的写作助手,检查接收到的文字的拼写、语法错误,对其进行润色:\n",
    "xiaohongshu": "扮演文本助理,使用小红书的 Emoji 风格润色我的内容,特点是每行开头都是一个相关表情符号,达到引人入胜的目的:\n",
    "Summarize": "归纳总结这些文字,同时用列表列出要点:\n",
    "translate": "将发送的文字内容都翻译成中文,如果内容是中文则翻译成标准的英文:\n",
    "Official": "你将扮演专业的微信公众号运营者,优化润色我给的内容成为爆款标题:\n",
}
async function chat (input, options, lang, prefixName) {
  const openai = require("axios").create({
    baseURL: "https://api.chatnio.net/v1/",
    headers: { Authorization: `Bearer ${options.apikey}` },
  });
​
let messages
  switch (lang) {
    case "en":
      messages = [
        {"role": "system", "content": "I want you act as a proofreader. I will provide you texts and I would like you to review them for any spelling, grammar, or punctuation errors."},
        {"role": "user", "content": `Proofread the following content and give me the result without extra delarations or comments:\n\n${input.text}`},
      ]
      break;
    case "zh":
      messages = [
        {"role": "system", "content": "你是我的写作助手,检查接收到的文字的拼写、语法错误,向我提供修改后的文字。"},
        {"role": "user", "content": `修改下面的文字,直接输出修改后的结果,不需要额外的声明:\n${input.text}`}
      ]
      break;
  }
​
  if (prefixName) {
      messages = [{"role": "user", "content": `${prefixes[prefixName]}${input.text}`}]
  }
​
  const { data } = await openai.post("/chat/completions", {
    model: "gpt-3.5-turbo",
    messages,
  });
  const result = data.choices[0].message;
  return input.text.trimEnd() + "\n\n" + result.content.trim();
};
​
exports.actions = [
{
  title: "公众号爆款标题",
  icon: "circle 标题",
  after: "paste-result",
  code: async (input, options) => chat(input, options, "", "Official"),
},
{
  title: "小红书风格",
  icon: "circle 红书",
  after: "paste-result",
  code: async (input, options) => chat(input, options, "", "xiaohongshu"),
},
{
  title: "总结内容",
  icon: "circle 总结",
  after: "paste-result",
  code: async (input, options) => chat(input, options, "", "Summarize"),
},
{
  title: "中英互译",
  icon: "square 翻译",
  after: "paste-result",
  code: async (input, options) => chat(input, options, "", "translate"),
},
{
  title: "润色",
  icon: "square 润色",
  after: "paste-result",
  code: async (input, options) => chat(input, options, "", "polish"),
},
];

安装:选中安装,弹出填写key为自己的Chat Nio-key【个人设置-key】

五、Utools扩展text ai

Github地址:https://github.com/IndieKKY/ai-text-assistant-utools

设置中修改API为https://api.chatnio.net

key为自己的Chat Nio-key【个人设置-key】

六、第三方AI客户端-chat-x

官网:https://6x.studio/chatx/

APP Store:https://apps.apple.com/us/app/chatx-ai-chat-client/id6446304087?platform=iphone

API修改为自定义https://api.chatnio.net

key为自己的Chat Nio-key【个人设置-key】

七、Web程序ChatGPT-Next-Web

开源:https://github.com/Yidadaa/ChatGPT-Next-Web#keep-updated

推荐Vercel一键部署

修改:设置中接口地址改为https://api.chatnio.net

key为自己的Chat Nio-key【个人设置-key】


 

0
0