Initial: integrated 2025 LawGraph (graphrag_pipeline) + 2026 kg_project

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-17 10:13:39 +08:00
commit 6c1a69af0d
83 changed files with 14295 additions and 0 deletions
+73
View File
@@ -0,0 +1,73 @@
# 环境变量配置说明
## 创建 .env 文件
`dofile` 目录下创建 `.env` 文件,添加以下配置:
```bash
# LLM API Keys
OPENAI_API_KEY=your_openai_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here
DASHSCOPE_API_KEY=your_dashscope_api_key_here
VOLCENGINE_ACCESS_KEY=your_volcengine_access_key_here
VOLCENGINE_SECRET_KEY=your_volcengine_secret_key_here
ZHIPUAI_API_KEY=your_zhipuai_api_key_here
# SiliconFlow API配置(硅基流动)
SILICONFLOW_API_KEY=sk-pvvtosiglncktlucwarxilvsypqcttqizgpcfdvodgcuaezn
SILICONFLOW_API_BASE=https://api.siliconflow.cn/v1
# 路径配置
DATA_DIR=../data
OUTPUT_DIR=./output
# 日志配置
LOG_LEVEL=INFO
# HanLP配置(可选)
HANLP_MODEL_PATH=
# LLM配置
TEMPERATURE=0.4
FREQUENCY_PENALTY=0.6
PRESENCE_PENALTY=0.6
# 文本处理配置
MAX_TEXTUNIT_LENGTH=500
```
## 硅基流动配置
硅基流动的API已经配置完成,您可以使用以下方式调用:
```python
from src.utils.llm_client import LLMClient, LLMProvider
from src.utils.config import load_config
config = load_config()
client = LLMClient(
provider=LLMProvider.SILICONFLOW,
model="你的模型名称", # 例如:Qwen/Qwen2.5-72B-Instruct
config=config
)
messages = [
{"role": "user", "content": "你好"}
]
response = client.chat(messages)
print(response)
```
## 支持的模型
硅基流动支持多种模型,常用的包括:
- `Qwen/Qwen2.5-72B-Instruct`
- `meta-llama/Llama-3.1-70B-Instruct`
- `01-ai/Yi-1.5-34B-Chat`
- 等等...
具体可用模型请查看硅基流动官网:https://siliconflow.cn/