Skip to content

Commit e57e674

Browse files
v1.0.0
1 parent f8d4d8e commit e57e674

39 files changed

+753
-513
lines changed

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 设置基础镜像,这里选择Python 3.8
1+
# 设置基础镜像,这里选择 Python 3.8
22
FROM python:3.8.19
33

44
# 设置工作目录
@@ -7,12 +7,19 @@ WORKDIR /app
77
# 复制项目文件到容器中的工作目录
88
COPY . /app
99

10-
# 安装依赖
11-
##这是 pip 安装时的一个选项,用于禁用缓存。当使用 --no-cache-dir 选项时,pip 将不会使用本地缓存,从而确保每次安装都是最新的包。这对于 Docker 镜像的构建是很有用的,因为可以避免缓存导致的问题。
12-
RUN pip install --no-cache-dir -r /app/requirements.txt
10+
# 安装 Python 依赖
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
# 安装 Node.js 和 npm
14+
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \
15+
&& apt-get install -y nodejs \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
# 安装 npm 依赖和 Playwright 浏览器
19+
RUN npm install && npx playwright install
1320

1421
# 暴露端口
1522
EXPOSE 8501
1623

17-
# 运行streamlit应用
24+
# 运行 Streamlit 应用
1825
CMD ["streamlit", "run", "web_ui.py", "--server.port", "8501"]

README.md

Lines changed: 89 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
### 基于LLM大模型的AI机器人
2-
一套基于开源框架、平台的AI语言模型机器人,集成人机对话,信息检索生成,PDF和URL解析对话等功能。全部采用免费开源API,以最低成本实现LLM定制化功能。
2+
一款开源的AI语言模型机器人,集成人机对话,信息检索生成,PDF和URL解析对话等功能。该平台优势为全部采用免费开源API,以最低成本实现LLM定制化功能。
33

44
## 工具和平台
5-
Langchain, Streamlit, Oracle Cloud, Groq, Docker, Baidu Cloud
5+
Langchain, Streamlit, Oracle Cloud, Groq,Google cloud, Baidu Cloud, Docker
6+
7+
## DEMO链接
8+
[Link](http://168.138.28.54:8501)
69

710
## 文件结构描述
811
<pre>
@@ -19,17 +22,76 @@ Langchain, Streamlit, Oracle Cloud, Groq, Docker, Baidu Cloud
1922
├── .gitgnore
2023
├── config_setting/
2124
│ ├── model_config.py #all models
22-
│ └── prompt_config.py
23-
├── about_page.py
24-
├── chat_page.py
25+
│ └── prompt_config.py #all prompts
26+
├── test.py #test cases
27+
├── cralwer_modules.py
28+
├── ui_images
29+
├── web_pages/
30+
│ ├── about_page.py
31+
│ ├── chat_page.py
32+
│ ├── online_chat_page.py
33+
│ ├── pdf_page.py
34+
│ └── url_page.py
2535
├── Dockerfile
26-
├── pdf_page.py
2736
├── requirements.txt
28-
├── summary_page.py
29-
├── url_page.py #ui
37+
├── web_ui.py # main interface
3038
</pre>
3139

40+
以下是优化后的Markdown写法:
41+
42+
## 功能描述
43+
44+
### Crawler爬虫模块
45+
46+
* 该模块主要包含三种爬虫方法: [Selenium](https://selenium-python.readthedocs.io/)[Playwright](https://playwright.dev/python/docs/intro)[基于Langchain的DuckDuckGo](https://api.python.langchain.com/en/latest/tools/langchain_community.tools.ddg_search.tool.DuckDuckGoSearchResults.html)
47+
48+
* 实验显示,Playwright的耗时只有Selenium的一半:
49+
| 模块 | 时间 |
50+
|-------------------|---------------|
51+
| selenium_url_crawler | 27s |
52+
| playwright_url_crawler | 11s |
53+
54+
* 由于Streamlit和Playwright的同步方式会产生冲突,所以应使用异步方法。 [参考](https://discuss.streamlit.io/t/using-playwright-with-streamlit/28380/5)
55+
56+
### Chat模块 (在线和离线)
57+
58+
1. 离线对话
59+
- 调用LLM大模型
60+
- 保留对话记录,便于后续分析与应用
61+
62+
2. 在线对话流程
63+
- 判断是否需要搜索引擎
64+
- 如果不需要,直接执行离线对话流程
65+
- 如果需要,则继续下一步
66+
- 生成用于搜索的query
67+
- 调用DuckDuckGo或使用自动化爬虫爬取Google搜索页面内容
68+
- 基于对话记录和搜索结果,综合分析并回答问题
69+
70+
### LLM大模型模块
71+
72+
以下是支持的LLM大模型:
73+
74+
| 模型名称 | tokens | 开发者 | 平台|
75+
|-------------------------|---------|----------| ----------|
76+
| ERNIE-Lite-8K | 8192 | Baidu | Baidu Cloud |
77+
| ERNIE-speed-128K | 128k | Baidu | Baidu Cloud |
78+
| Gemma-7B-IT | 8192 | Google | Groq |
79+
| Gemini-1.5-Flash-Latest | 8192 | Google | Google Cloud |
80+
| Llama3-70B-8192 | 8192 | Meta | Groq |
81+
| Llama3-8B-8192 | 8192 | Meta | Groq |
82+
| Mixtral-8x7B-32768 | 32768 | Mistral | Groq |
83+
84+
### URL检索模块
85+
86+
1. 基于 [Langchain-RAG检索生成方法](https://python.langchain.com/v0.1/docs/get_started/introduction/)
87+
2. 检索流程:
88+
1. 输入URL并判断是否正确。
89+
2. 爬虫URL网页内容,生成向量嵌入(当前使用CohereEmbeddings嵌入API)。
90+
3. 根据问题检索top_k个相关文档。
91+
4. 基于文档内容回答问题。
92+
3293
## 使用教程
94+
3395
### 本地部署
3496
1. 下载依赖库
3597
```bash
@@ -54,15 +116,28 @@ Langchain, Streamlit, Oracle Cloud, Groq, Docker, Baidu Cloud
54116
QIANFAN_SK= <QIANFAN-SK>
55117
```
56118
4. 运行
119+
```bash
120+
play playwright install
121+
```
57122
```bash
58123
streamlit run web_ui.py
59124
```
60125
### 服务器部署
61-
[wiki链接](https://github.com/Boomm-shakalaka/AIBot-LLM/wiki/Oracle%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%90%AD%E5%BB%BA%E6%95%99%E7%A8%8B)
62-
126+
1. [Docker链接](https://hub.docker.com/repository/docker/jiyuanc1/aibot/general)
127+
2. 服务器部署教程:[wiki链接](https://github.com/Boomm-shakalaka/AIBot-LLM/wiki/Oracle%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%90%AD%E5%BB%BA%E6%95%99%E7%A8%8B)
63128

129+
## 版本更新记录
130+
v1.0.0 (oracle cloud)
131+
1. 优化pdf chat功能中的简历评估功能,增加对话
132+
2. 新增playwright爬虫模块,优化异步调用
133+
3. 新增url chat爬虫模块调用和来源检索选择功能
134+
4. 实现基于playwright在线搜索功能
135+
5. 优化chat history
136+
6. 整合cralwer模块
137+
7. 整合prompt配置内容
138+
8. 页面美化
139+
9. 新增about页面
64140

65-
## 版本更新
66141
v0.0.5
67142
1. 新增百度千帆大模型(ERNIE-Lite-8K和ERNIE-Speed-128K免费开放)
68143
2. 新增gemini模型(gemini模型不支持streaming输出,暂未开放)
@@ -78,18 +153,18 @@ v0.0.4.1
78153
5. 新增max tokens限制
79154
6. Gemma存在输出乱码问题
80155

81-
v0.0.4 (oracle cloud)
156+
v0.0.4
82157
1. 使用streamlit_option_menu框架重构界面
83158
2. 新增在线搜索功能,基于duckduckDuckDuckGoSearch
84159
3. 优化异步方法处理搜索功能
85160
4. 新增搜索agent提示词
86161

87-
v0.0.3 (oracle cloud)
162+
v0.0.3
88163
1. 优化和完善URLBot检索能力
89164
2. 优化和完善URLPage网页架构
90165
3. 使用Cohere API进行Embedding
91166

92-
v0.0.2.1 (oracle cloud)
167+
v0.0.2.1
93168
1. 优化侧边栏架构
94169
2. 优化chatbot对话能力,优化prompt
95170
3. 优化chatbot对话体验,更改为streaming输出流模式
-3.7 KB
Binary file not shown.
-2.93 KB
Binary file not shown.
-2.54 KB
Binary file not shown.
-1.91 KB
Binary file not shown.
-3.71 KB
Binary file not shown.
7.33 KB
Binary file not shown.
7.33 KB
Binary file not shown.

0 commit comments

Comments
 (0)