Tencent / cherry-markdown

✨ A Markdown Editor
Other
3.36k stars 387 forks source link

ChatGPT是否可以接入第三方的API #582

Open guugg opened 9 months ago

guugg commented 9 months ago

Is your any problem? Please describe. 不是所有人都可以连上官方的,更多的是通过第三方的api

Additional context

我在cherry-markdown.js文件中修改exports.BASE_PATH = "https://api.openai.com/v1".replace(/\/+$/, "");中的连接,是可以的,可以让用户自定义选择吗? 比如:

  openai: {
    apiKey: '***', // apiKey
    // proxy: {
    //   host: '127.0.0.1',
    //   port: '7890',
    // }, // http & https代理配置
   apilink: 'https://github.com/',
    ignoreError: false, // 是否忽略请求失败,默认忽略 
  },
sunsonliu commented 9 months ago

感谢反馈,我们支持下~

guugg commented 9 months ago

文章连续对话有点费tokens,默认读取了整个文章。

yangzhenyu322 commented 8 months ago

请问完成好chatGPT的配置后如何使用呢: // chatGpt的openai配置 openai: { apiKey: 'xxx', // apiKey // proxy: { // host: '127.0.0.1', // port: '7890', // }, // http & https代理配置 apilink: 'https://github.com/', ignoreError: false, // 是否忽略请求失败,默认忽略 }

sunsonliu commented 8 months ago

请问完成好chatGPT的配置后如何使用呢: // chatGpt的openai配置 openai: { apiKey: 'xxx', // apiKey // proxy: { // host: '127.0.0.1', // port: '7890', // }, // http & https代理配置 apilink: 'https://github.com/', ignoreError: false, // 是否忽略请求失败,默认忽略 }

https://github.com/Tencent/cherry-markdown/wiki/%E5%A6%82%E4%BD%95%E6%8E%A5%E5%85%A5chatGPT%E5%AE%9E%E7%8E%B0%E7%BB%AD%E5%86%99%E3%80%81%E6%80%BB%E7%BB%93%E7%AD%89%E8%83%BD%E5%8A%9B 可以参考这篇wiki哈