# python-ai-example **Repository Path**: potato1314/python-ai-example ## Basic Information - **Project Name**: python-ai-example - **Description**: AI相关示例 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-22 - **Last Updated**: 2026-05-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 创建虚拟环境: ```bash python3 -m venv .venv ``` ### 安装依赖包: ```bash source .venv/bin/activate && pip install -r requirements.txt source .venv/bin/activate && pip install langchain langchain-community ``` ### 模型先下载好,放到目录:rag/chroma_models` ``` shibing624/text2vec-base-chinese 文本向量模型 BAAI/bge-reranker-base 重排序模型 ``` ### 启动FastAPI应用 : ``` ./start.sh # 开发环境 ./start.sh testing # 测试环境 ./start.sh production # 生产环境 ``` ### 测试接口 ``` python3 -m pytest tests/test_ai.py -v ``` 导出包 ``` conda env export > environment.yml ``` 更新包 ``` conda env update -f environment.yml ```