Sign inSign up

cwy829/ai-assistant

By cwy829

•Updated about 2 years ago

A ai assistant for you.

Image
0

2.8K

cwy829/ai-assistant repository overview

github源码地址⁠

⁠一个 AI 助手

这是一个 AI 项目,集成各种开放 AI 的能力。

⁠项目介绍

截图

让每个人都拥有可以使用 AI 的能力。

⁠node 版本

需要 node >= 18 版本

⁠环境变量

在根目录下,复制一个.env.example 文件重命名为.env,修改其中的字段:

# Server Port, eg: 3000
SERVER_PORT=3000

# TIMEOUT Time,eg: 2 * 60 * 1000
CHATGPT_REQUEST_TIMEOUT=

# OpenAI API Base URL - https://api.openai.com/docs
# Or self-built service address, eg api2d: https://openai.api2d.net/v1
OPENAI_API_BASE_URL =

# OpenAI API Key - https://platform.openai.com/account/api-keys
# Or self-built service key, eg api2d: fkxxx
OPENAI_API_KEY=

# CUSTOM_PROXY represents an http proxy. If left blank or not passed any value,
# it means that the http proxy is not enabled.
CUSTOM_PROXY=

  • OPENAI_API_BASE_URL: Indicates the base URL used for chatgpt, which can also use a third-party self-built service address, such as the endpoint of api2d⁠. The default value here is https://api.openai.com/v1.
  • OPENAI_API_KEY: Represents the official OpenAI API key⁠ that will be used. Alternatively, you can use a third-party service key, such as api2d⁠.
  • PROXY_ADDRESS: Scientific Internet access proxy configuration, for example: http://xxx⁠.
  • OPENAI_ACCESS_TOKEN: OpenAI's access_token⁠, The field usually use with API_REVERSE_PROXY,Indicates that unofficial APIs will be used to access chatgpt.
  • API_REVERSE_PROXY: Indicates available unofficial reverse proxies. By default it adopts "https://ai.fakeopen.com/api/conversation⁠". For details please refer transitive-bullshit 大佬⁠.
  • CUSTOM_API_URL: Indicates the third party support service url.
  • CUSTOM_COOKIE: Indicates the third party may need cookie info.
  • CUSTOM_PROXY: represents an http proxy. If left blank or not passed any value, it means that the http proxy is not enabled.

Priority: OPENAI_API_KEY > OPENAI_ACCESS_TOKEN > CUSTOM_API_URL。

⁠如何开发?

⁠本地开发
  1. 本地新增 .env⁠ 文件,配置相应参数。
  2. 首先安装依赖,根目录下安装依赖,使用 pnpm i 安装代码。
  3. 启动项目:根目录下执行npm run dev。
  4. 访问项目地址:http://localhost:3000
⁠从 docker 获取
⁠获取 Image
docker image pull cwy829/ai-assistant:0.0.1
⁠启动 Container

下面命令里面 ~/docker-data/.env 需要替换成你的 .env 文件存放的地址,更多关于 .env 的信息参考这里⁠

docker run -d -p 3000:3000 -v ~/docker-data/.env:/ai-assistant/.env --name ai-assistant cwy829/ai-assistant:0.0.1

更多关于 docker 的知识,请查看 文档⁠

⁠如何使用?

⁠方式一:一键启动

在根目录下执行 npm start

⁠方式二:分前后端启动
  1. 启动前端:npm run dev:fe
  2. 启动后端:npm run dev:be
  3. 访问前端项目地址:http://localhost:8000

Tag summary

Content type

Image

Digest

sha256:d8b216ae8…

Size

77.7 MB

Last updated

about 2 years ago

docker pull cwy829/ai-assistant