This commit is contained in:
杨煜 2025-10-02 18:59:18 +08:00
parent 4bd343c237
commit e6d7b201fd
6 changed files with 210 additions and 2 deletions

19
.env Normal file
View File

@ -0,0 +1,19 @@
# Application Settings
APP_NAME="LangChain Learning Kit"
DEBUG=False
LOG_LEVEL=INFO
# Database Configuration
DATABASE_URL=mysql+pymysql://root:123456@localhost:3306/langchain_learning
# OpenAI Configuration
OPENAI_BASE_URL=https://api.openai-proxy.org/v1
OPENAI_API_KEY=sk-QcFv70swj4t8PlUpC7lKHIcfH8URo8USzPjfZXTQsd1Bv8C6
# FAISS Storage
FAISS_BASE_PATH=C:\\work\\workspace\\PycharmProjects\\study-work\\faiss
# Server Configuration
HOST=0.0.0.0
PORT=8000

4
.gitignore vendored
View File

@ -27,7 +27,7 @@ env/
.venv .venv
# IDE # IDE
.vscode/ # .vscode/
.idea/ .idea/
*.swp *.swp
*.swo *.swo
@ -35,7 +35,7 @@ env/
.DS_Store .DS_Store
# Environment Variables # Environment Variables
.env # .env
.env.local .env.local
# Database # Database

62
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,62 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "FastAPI Dev Server",
"type": "python",
"request": "launch",
"module": "uvicorn",
"args": [
"app.main:app",
"--reload",
"--host", "0.0.0.0",
"--port", "8000"
],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"env": {
"PYTHONPATH": "${workspaceFolder}"
},
"justMyCode": false
},
{
"name": "FastAPI Production",
"type": "python",
"request": "launch",
"module": "uvicorn",
"args": [
"app.main:app",
"--host", "0.0.0.0",
"--port", "8000",
"--workers", "1"
],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"env": {
"PYTHONPATH": "${workspaceFolder}"
},
"justMyCode": false
},
{
"name": "Run Main.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/app/main.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"env": {
"PYTHONPATH": "${workspaceFolder}"
},
"justMyCode": false
},
{
"name": "Environment Verification",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/verify_env.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false
}
]
}

31
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,31 @@
{
"python.defaultInterpreterPath": "./venv/Scripts/python.exe",
"python.terminal.activateEnvironment": true,
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--line-length", "88"],
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"files.exclude": {
"**/__pycache__": true,
"**/*.pyc": true,
".pytest_cache": true,
"*.egg-info": true
},
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"tests"
],
"python.envFile": "${workspaceFolder}/.env",
"terminal.integrated.env.windows": {
"PYTHONPATH": "${workspaceFolder}"
},
"files.associations": {
"*.env": "properties",
"*.env.*": "properties"
}
}

93
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,93 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Activate Conda Environment",
"type": "shell",
"command": "conda",
"args": [
"activate",
"pyth-311"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "Install Dependencies",
"type": "shell",
"command": "pip",
"args": [
"install",
"-r",
"requirements.txt"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "Database Migration",
"type": "shell",
"command": "alembic",
"args": [
"upgrade",
"head"
],
"options": {
"cwd": "${workspaceFolder}/app"
},
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "Run Tests",
"type": "shell",
"command": "pytest",
"args": [
"-v",
"tests/"
],
"group": "test",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "Verify Environment",
"type": "shell",
"command": "python",
"args": [
"verify_env.py"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
}
]
}

3
frontend/.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}