diff --git a/.env b/.env new file mode 100644 index 0000000..4a6b443 --- /dev/null +++ b/.env @@ -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 diff --git a/.gitignore b/.gitignore index 7da4ec1..ddb44fd 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,7 @@ env/ .venv # IDE -.vscode/ +# .vscode/ .idea/ *.swp *.swo @@ -35,7 +35,7 @@ env/ .DS_Store # Environment Variables -.env +# .env .env.local # Database diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2a88f63 --- /dev/null +++ b/.vscode/launch.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f541405 --- /dev/null +++ b/.vscode/settings.json @@ -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" + } +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..a320816 --- /dev/null +++ b/.vscode/tasks.json @@ -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": [] + } + ] +} \ No newline at end of file diff --git a/frontend/.vscode/extensions.json b/frontend/.vscode/extensions.json new file mode 100644 index 0000000..a7cea0b --- /dev/null +++ b/frontend/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar"] +}