chatai/README.md
洛天依 644e1339fb
All checks were successful
Build / Build (push) Successful in 1m22s
feat: home page
2025-01-21 19:11:48 +00:00

75 lines
2.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Chat AI
提供类似 QQ 界面的公共 AI 聊天机器人,基于 Google Gemini 模型。
**注意**
- 不支持视频、图片、音频等多模态输入。
- 完全公开、无频率限制与身份认证。建议使用免费的 API Key 并禁用结算账号。
## 使用方法
从「发行版」下载最新版本的压缩包,解压缩。你可以使用 `-h` 参数查看帮助信息:
```bash
./chatai -h
```
要正常启动服务器,您需要设置环境变量 `GOOGLE_AI_KEY`。您可以在 [Google AI Studio](https://aistudio.google.com) 免费获得一个(需要 Google 账号)。
```bash
export GOOGLE_AI_KEY=your-key
./chatai
```
您也可以使用 Docker 运行:
```bash
docker run -d -p 57120:7120 -e GOOGLE_AI_KEY=your-key \
--name chatai lty.name/chatai
```
如果需要自定义 AI Agent请将您的 AI Agent 配置文件映射到 `/app/agents` 目录:
```bash
docker run -d -p 57120:7120 -e GOOGLE_AI_KEY=your-key \
-v /path/to/your/agents:/app/agents \
--name chatai lty.name/chatai
```
可以通过 `-model` 参数修改模型,推荐使用下面两个免费模型:
- `gemini-1.5-flash`
- `gemini-2.0-flash-exp`
## 配置文件
AI Agent 内置了一些默认的 AI Agent但您也可以自定义 AI Agent。
AI Agent 的配置文件目录结构如下:
```
agents
`- <AgentID> Agent ID, 必须由小写字母、数字、横线组成,且 2-80 个字符
|- agent.json 配置文件
|- avatar.webp 头像
|- system_prompt.txt 系统提示
`- initial_prompt.txt 初始提示
```
下面是一个配置文件的示例:
```json
{
"id": "luo",
"name": "洛天依AI",
"desc": "世界第一的 ∞ 吃货殿下~",
"footer": "此 AI 并非洛天依官方提供,请勿用于商业用途。",
"primaryColor": "#6cb6df",
"secondaryColor": "#66ccff",
"accentColor": "#a62f35"
}
```
其中:
- `id` 是 Agent ID必须和文件夹名称一致。
- `name` 是 Agent 名称,将显示在聊天界面。
- `desc` 是 Agent 描述,将显示在聊天界面。
- `footer` 是 Agent 页脚,用于显示版权信息、免责声明等。
- `primaryColor` 是主色调,将用于聊天界面的背景色。可选,如果未设置则使用默认值。
- `secondaryColor` 是次色调,将用于聊天界面的背景色。可选,如果未设置则使用默认值。
- `accentColor` 是强调色,将用于聊天界面的背景色。可选,如果未设置则使用默认值。
## 版权
[Unlicense](https://unlicense.org/)