chatai/README.md
2024-12-25 17:18:23 +00:00

74 lines
2.5 KiB
Markdown
Raw 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.

# Luo Tianyi CodeLab AI Agent
提供类似 QQ 界面的公共 AI 聊天机器人,基于 Google Gemini 模型。
**注意**
- 不支持视频、图片、音频等多模态输入。
- 完全公开、无频率限制与身份认证。建议使用免费的 API Key 并禁用结算账号。
- 暂时没有列出所有模型的功能。
## 使用方法
从 GitHub Release 下载最新版本的压缩包,解压缩。你可以使用 `-h` 参数查看帮助信息:
```bash
./ai-agent-web -h
```
要正常启动服务器,您需要设置环境变量 `GOOGLE_AI_KEY`。您可以在 [Google AI Studio](https://aistudio.google.com) 免费获得一个(需要 Google 账号)。
```bash
export GOOGLE_AI_KEY=your-key
./ai-agent-web
```
您也可以使用 Docker 运行:
```bash
docker run -d -p 57120:7120 -e GOOGLE_AI_KEY=your-key \
--name ai-agent-web ghcr.io/ltylab/codelab-ai-agent
```
如果需要自定义 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 ai-agent-web ghcr.io/ltylab/codelab-ai-agent
```
可以通过 `-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": "世界第一的 ∞ 吃货殿下~",
"primaryColor": "#6cb6df",
"secondaryColor": "#66ccff",
"accentColor": "#a62f35"
}
```
其中:
- `id` 是 Agent ID必须和文件夹名称一致。
- `name` 是 Agent 名称,将显示在聊天界面。
- `desc` 是 Agent 描述,将显示在聊天界面。
- `primaryColor` 是主色调,将用于聊天界面的背景色。可选,如果未设置则使用默认值。
- `secondaryColor` 是次色调,将用于聊天界面的背景色。可选,如果未设置则使用默认值。
- `accentColor` 是强调色,将用于聊天界面的背景色。可选,如果未设置则使用默认值。
## 版权
[Unlicense](https://unlicense.org/)