Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ backend/chroma_db/

# Uploads
uploads/
backend/data/

# IDE
.vscode/
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.13
3.12
5 changes: 5 additions & 0 deletions PROMPT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
重构backend文件夹中的内容,将rag_system修改为一个通用的rag系统,输入改为任意的md文件,保持各文件名不变;
不再需要使用大模型接口,不再需要ai_generator.py文件、session_manager.py文件;
rag_system对外提供两个接口:
1. 初始化接口,输入为文件夹路径,输出为初始化完成的rag系统;
2. 查询接口,输入为查询语句,输出为查询结果;2
12 changes: 12 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@



```cmd
# 执行测试用例
uv run python -m pytest tests/ -v --tb=short
uv run python -m pytest tests/ -v


# 运行单个测试文件
uv run python -m pytest tests/test_document_processor.py -v --tb=short
```
172 changes: 0 additions & 172 deletions backend/ai_generator.py

This file was deleted.

150 changes: 0 additions & 150 deletions backend/app.py

This file was deleted.

5 changes: 0 additions & 5 deletions backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@
class Config:
"""Configuration settings for the RAG system"""

# Anthropic API settings
ANTHROPIC_API_KEY: str = os.getenv("ANTHROPIC_API_KEY", "")
ANTHROPIC_MODEL: str = "claude-sonnet-4-20250514"

# Embedding model settings
EMBEDDING_MODEL: str = "all-MiniLM-L6-v2"

# Document processing settings
CHUNK_SIZE: int = 800 # Size of text chunks for vector storage
CHUNK_OVERLAP: int = 100 # Characters to overlap between chunks
MAX_RESULTS: int = 5 # Maximum search results to return
MAX_HISTORY: int = 2 # Number of conversation messages to remember

# Database paths
CHROMA_PATH: str = "./chroma_db" # ChromaDB storage location
Expand Down
Loading