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### 本地部署
34961 . 下载依赖库
3597 ``` bash
@@ -54,15 +116,28 @@ Langchain, Streamlit, Oracle Cloud, Groq, Docker, Baidu Cloud
54116 QIANFAN_SK= < QIANFAN-SK>
55117 ` ` `
561184. 运行
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- # # 版本更新
66141v0.0.5
671421. 新增百度千帆大模型(ERNIE-Lite-8K和ERNIE-Speed-128K免费开放)
681432. 新增gemini模型(gemini模型不支持streaming输出,暂未开放)
@@ -78,18 +153,18 @@ v0.0.4.1
781535. 新增max tokens限制
791546. Gemma存在输出乱码问题
80155
81- v0.0.4 (oracle cloud)
156+ v0.0.4
821571. 使用streamlit_option_menu框架重构界面
831582. 新增在线搜索功能,基于duckduckDuckDuckGoSearch
841593. 优化异步方法处理搜索功能
851604. 新增搜索agent提示词
86161
87- v0.0.3 (oracle cloud)
162+ v0.0.3
881631. 优化和完善URLBot检索能力
891642. 优化和完善URLPage网页架构
901653. 使用Cohere API进行Embedding
91166
92- v0.0.2.1 (oracle cloud)
167+ v0.0.2.1
931681. 优化侧边栏架构
941692. 优化chatbot对话能力,优化prompt
951703. 优化chatbot对话体验,更改为streaming输出流模式
0 commit comments