Spaces:
Sleeping
Sleeping
Ronio Jerico Roque commited on
Commit ·
33dc83e
1
Parent(s): 83a4aff
Refactor database connection to use environment variable and update MCP server URL
Browse filesFiles changed (5)
- .env+2-1
- .gitignoreAdded+114
- __pycache__/app.cpython-313.pyc
- agent.py+1-1
- app.py+2-2
112OPENAI_API_KEY=sk-proj-G_xZCwWLuIupf0qNUgOGJ7lnZcN-i5xU3p0tMFDntNFn4v-PQrx_cMlJ6medwDjMCu3PDkNLc_T3BlbkFJ6kVCZC3im6xrs4cD4MZ1jtr9PGTqwnENFiD87k4uzR2Jo6bm5E6jp5h_AQVuNiMZq9ajzrzEoAOPENAI_API_KEY=sk-proj-G_xZCwWLuIupf0qNUgOGJ7lnZcN-i5xU3p0tMFDntNFn4v-PQrx_cMlJ6medwDjMCu3PDkNLc_T3BlbkFJ6kVCZC3im6xrs4cD4MZ1jtr9PGTqwnENFiD87k4uzR2Jo6bm5E6jp5h_AQVuNiMZq9ajzrzEoAdb=postgres://postgres:apple@172.17.21.23:5432/agency_data123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114# Environment variables.env.env.local.env.development.env.test.env.production
# Python__pycache__/*.py[cod]*$py.class*.so.Pythonbuild/develop-eggs/dist/downloads/eggs/.eggs/lib/lib64/parts/sdist/var/wheels/share/python-wheels/*.egg-info/.installed.cfg*.eggMANIFEST
# Virtual environments.venv/venv/ENV/env/.env/
# IDE.vscode/.idea/*.swp*.swo*~
# OS.DS_Store.DS_Store?._*.Spotlight-V100.Trashesehthumbs.dbThumbs.db
# Logs*.loglogs/log/
# Database*.db*.sqlite*.sqlite3
# Cache.cache/.pytest_cache/.coveragehtmlcov/
# Jupyter Notebook.ipynb_checkpoints
# FastAPI.pytest_cache/
# Node modules (if any frontend)node_modules/
# Temporary files*.tmp*.temptemp/tmp/
# API Keys and secretssecrets.jsonconfig.jsoncredentials.json
# Test filestest_*.py*_test.pytests/
# Documentation buildsdocs/_build/
# Coverage reports.coveragecoverage.xml*.cover.hypothesis/
# mypy.mypy_cache/.dmypy.jsondmypy.json
# Pyre type checker.pyre/
# Local developmentlocal_settings.py18 unmodified lines192021222223242518 unmodified lines { "type": "mcp", "server_label": "clickup_data", "server_url": "http://127.0.0.1:8000", "server_url": "https://roniorque-fastapi-test-server.hf.space/mcp", "require_approval": "never", } ]40 unmodified lines4142434445444546474840 unmodified lines # Only allow SELECT queries if not input_data.query.lower().strip().startswith('select'): return ToolOutput(result="Error: Only SELECT queries are allowed") conn = await asyncpg.connect('postgres://postgres:apple@172.17.21.23:5432/agency_data')
conn = await asyncpg.connect(dsn=os.getenv("db")) rows = await conn.fetch(input_data.query + " LIMIT 10") await conn.close() .env+2-1
.gitignoreAdded+114
__pycache__/app.cpython-313.pyc
agent.py+1-1
app.py+2-2