FileChat/README.md
2024-09-04 10:20:19 +08:00

54 lines
1.2 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.

# 文件对话demo
调用智谱AI文件对话接口进行问答
## 代码结构
```
.
├── LICENSE (Git仓库的开源许可证)
├── README.md (本文档)
├── environment.yml (Conda使用的环境需求文件)
├── file_chat.py (文件对话Streamlit页面)
└── requirements.txt (Pip使用的环境需求文件)
```
## 环境配置-Conda版本
* 安装Conda建议使用命令行安装 [Miniconda](https://docs.anaconda.com/miniconda/#quick-command-line-install)
* 创建虚拟环境
```
conda env create -f environment.yml --name <虚拟环境名称>
```
## 环境配置-Venv版本
* 安装Python版本>=3.10, 参考各操作系统对应网上教程
* 创建虚拟环境
```
python3 -m venv venv
```
## 启动
* 激活虚拟环境
* Conda
```
conda activate <虚拟环境名称>
```
* Venv
```
source venv/bin/activate
```
* 启动文件对话用户界面
```
streamlit run file_chat.py
```
## 一些相关开发技术文档链接
* Streamlit https://docs.streamlit.io/
* 智谱文件问答APIhttps://bigmodel.cn/dev/howuse/fileqa
* 智谱RAG问答APIhttps://bigmodel.cn/dev/howuse/retrieval