yokingma / search_with_ai

🤖 Free Search with AI, 💡 Open-Source Perplexity, 📍 Support Ollama/SearXNG, Support Docker deployment. 让AI大模型和搜索引擎回答你的问题,支持本地大模型(Ollama)、聚合搜索引擎SearXNG,支持Docker一键部署。
https://isou.chat
MIT License
316 stars 57 forks source link

对话没有显示,数据源列表正常,请帮忙看下 #2

Closed seekme-ai closed 2 months ago

seekme-ai commented 2 months ago

image 对话answer没有显示,数据源列表正常,请帮忙看下

yokingma commented 2 months ago

@seekme-ai 用的是哪家的大模型?有没有配置对应的KEY? 配置文件是根目录下的.env文件

# Bing search key
BING_SEARCH_KEY=
# Google search key
GOOGLE_SEARCH_KEY=
GOOGLE_SEARCH_ID=
# aliyun key
ALIYUN_KEY=
# Yi Key
YI_KEY=
# google gemini
GOOGLE_KEY=
GOOGLE_PROXY_URL=
# baidu
BAIDU_KEY=
BAIDU_SECRET=
# tencent KEY:ID, SECRET:KEY
TENCENT_KEY=
TENCENT_SECRET=
# openai key
OPENAI_KEY=
# openai proxy
OPENAI_PROXY_URL=https://api.openai.com/v1
# moonshot
MOONSHOT_KEY=
# lepthon key
LEPTON_KEY=
# Local llm: Ollama host, default http://localhost:11434
OLLAMA_HOST=http://localhost:11434
# Free search engine: https://www.searx.space/
SEARXNG_HOSTNAME=http://localhost:8080
Somnus1437 commented 2 months ago

oopenai_key支持中转吗?还有Perplexity配置在哪里?

yokingma commented 2 months ago

@Somnus1437 支持的,demo站点用的就是中转的。

neosalius commented 2 months ago

我这边也是一样的,使用的是docker直接搭建的,没有进行修改 截图

yokingma commented 2 months ago

@neosalius 因为docker使用了 FreeGPT35 这个项目提供的API,无法确定其稳定性,首先确保你的网络能正常访问chatgpt官网。

我自己目前用的是这个提供的API的代理gpt3.5/4(送免费额度), 暂时还没什么问题,我也无法确定其稳定性。

如果你注册使用后者,你需要修改.env后,用docker重新构建运行。

# openai key
OPENAI_KEY=你的令牌
# openai proxy, default is for docker-compose, could modify if you need.
OPENAI_PROXY_URL=https://burn.hair/v1
neosalius commented 2 months ago

谢谢,根据您提供的方法,已经解决了。另外请问,如果我要使用openai的官方API,该如何设置呢?

yokingma commented 2 months ago

@neosalius

# openai key
OPENAI_KEY=你的令牌
# 这里设置为openai官方的url
OPENAI_PROXY_URL=https://api.openai.com/v1

某些不能访问到openai官方api的地区,可能会使用代理域名跳转,只需要变更这部分就行了 https://{你的代理域名}/v1

neosalius commented 2 months ago

不好意思,给您提供了错误的信息。好像不是API的原因,我使用了您刚刚推荐的API后,短暂的可以了,但是吃个饭回来又不行了。之后我根据您提供的方法,设置为了openai的官方API,依然不行。

yokingma commented 2 months ago

不好意思,给您提供了错误的信息。好像不是API的原因,我使用了您刚刚推荐的API后,短暂的可以了,但是吃个饭回来又不行了。之后我根据您提供的方法,设置为了openai的官方API,依然不行。

你的网络是可以访问到chatgpt.com官网的吧,短暂可以的话,说明api是可以的。

neosalius commented 2 months ago

可以访问chatgpt.com官网,并且,使用您推荐的API代理也不行,应该不是网络的问题吧?

yokingma commented 2 months ago

可以访问chatgpt.com官网,并且,使用您推荐的API代理也不行,应该不是网络的问题吧?

docker 重新构建的时候记得清除旧的容器镜像。

下面是demo站点isou.chat的配置可以参考下,只使用了上面说的那个API: .env

# Bing search key
BING_SEARCH_KEY=
# aliyun key
ALIYUN_KEY=
# Yi Key
YI_KEY=
# google gemini
GOOGLE_KEY=
GOOGLE_PROXY_URL=
# baidu
BAIDU_KEY=
BAIDU_SECRET=
# tencent KEY:ID, SECRET:KEY
TENCENT_KEY=
TENCENT_SECRET=
# openai key
OPENAI_KEY=mykey
# openai proxy, default is for docker-compose, could modify if you need.
OPENAI_PROXY_URL=https://burn.hair/v1
# moonshot
MOONSHOT_KEY=
# lepthon key
LEPTON_KEY=
# Local llm: Ollama hostname, could modify if you need.
OLLAMA_HOST=http://host.docker.internal:11434
# Searxng hostname, could modify if you need.
SEARXNG_HOSTNAME=http://searxng:8080
# The count of resources referenced
REFERENCE_COUNT = 8

docker-compose.yaml,demo站点部署删除了freegpt35

services:
  search:
    build: ./
    container_name: AISearch
    ports:
      - "3000:3000"
    restart: always

  searxng:
    container_name: searxng
    image: docker.io/searxng/searxng:latest
    restart: always
    ports:
      - "127.0.0.1:8080:8080"
    volumes:
      - ./searxng:/etc/searxng:rw
    environment:
      - SEARXNG_BASE_URL=https://${SEARXNG_HOSTNAME:-localhost}/
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "1"
neosalius commented 2 months ago

谢谢您,应该是因为我没有清楚旧的容器,现在又可以了。