lencx / Noi

🚀 Power Your World with AI - Explore, Extend, Empower.
https://noi.nofwl.com
5.58k stars 405 forks source link

申请加入一个密塔 AI 搜索到 AI(内陆版)里 #64

Open ianchang0822 opened 4 months ago

ianchang0822 commented 4 months ago

您好,可以加一个密塔 AI 搜索嘛? https://metaso.cn/ 在国内算结果整合的比较好的,跟 perplexity 很像

huhusmang commented 4 months ago

自己之前尝试写了一个,可以实现通过统一 prompt 输入,但是无法实现自动点击 button 发送,应该是没有触发到 button 可以点击的 Event(不会前端,所以不太懂🫡

class MetaSoAsk extends NoiAsk {
  static name = 'MetaSo';
  static url = 'https://metaso.cn/';

  static sync(message) {
    var inputElement = document.querySelector('textarea[placeholder*="点击输入想了解的问题"]');
    if (inputElement) {
      const inputEvent = new Event('input', { bubbles: true });
      inputElement.value = message;
      inputElement.dispatchEvent(inputEvent);
    }
  }

  // To Fix
  static submit() {
    const btn = document.querySelector('.MuiStack-root .send-arrow-button');
    // const btn = document.querySelector('button[type="button"]');
    if (btn){
      btn.disabled = false;
      this.autoClick(btn);
    }
  }
}

问题应该在这里: image

ru61sco commented 3 months ago

直接添加网址就可以了呀