Spaces:
Build error
Build error
Commit ·
d7b323e
1
Parent(s): 0989d5f
updated code agent
Browse filesFiles changed (7)
11 unmodified lines121314151516171819202111 unmodified lineshf_oauth_expiration_minutes: 480---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-referenceCheck out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
To generate a `requirements.txt` file compatible with **Python 3.10** for deployment on a Hugging Face Space, run the following command:
```bashuv pip compile pyproject.toml --python 3.10 -o requirements.txt```32 unmodified lines333435363738394011 unmodified lines525354555657585960616263646566672 unmodified lines70717273747576777879806781828384858687888932 unmodified linesfrom dataclasses import dataclass, replacefrom typing import Any, Optionalimport re # For stripping markdown fencesimport cv2 # OpenCV – image manipulationimport pandas as pd # Pandas – DataFrame / CSV utilities
from langchain_groq import ChatGroqfrom langchain_core.messages import AIMessage, HumanMessage, SystemMessage11 unmodified lines# 1. Code‑execution tool (whitelisted built‑ins)###############################################################################
# ---------------------------------------------------------------------------# Limited import helper – only expose specific third-party libs to user code# ---------------------------------------------------------------------------
def _safe_import(name, globals=None, locals=None, fromlist=(), level=0): """Whitelisted __import__ permitting just `cv2` and `pandas`.""" if name in {"cv2", "pandas"}: return __import__(name, globals, locals, fromlist, level) raise ImportError(f"Import of module '{name}' is disabled in this sandbox.")
ALLOWED_BUILTINS: dict[str, Any] = { "print": print, "range": range,2 unmodified lines "sum": sum, "min": min, "max": max, "open": open, # Needed by pandas for file I/O "__import__": _safe_import, # Allow limited, safe imports}
@tooldef python_exec(code: str) -> str: """Execute **Python** inside a restricted namespace and capture STDOUT.""" code = textwrap.dedent(code) exec_globals = {"__builtins__": ALLOWED_BUILTINS} exec_globals = { "__builtins__": ALLOWED_BUILTINS, "cv2": cv2, "pd": pd, # Common alias "pandas": pd, # Full name } local_ns: dict[str, Any] = {} stdout = io.StringIO() try:25 unmodified lines262728293031323325 unmodified lines "llama-index-readers-wikipedia>=0.3.0", "llama-index-tools-duckduckgo>=0.3.0", "llama-index-tools-tavily-research>=0.3.0", "opencv-python>=4.11.0.86", "pandas>=2.2.3", "rich>=14.0.0", "sentence-transformers>=4.1.0", "supabase>=2.15.3",12345679 unmodified lines171819202122232425262727 unmodified lines555657585960616238 unmodified lines1011021031041051061071081091101111129 unmodified lines12212312412512612712813 unmodified lines1421431441451461471481491501511521531541551561574 unmodified lines1621631641481651661671681691707 unmodified lines1781791801811821831841852 unmodified lines1881891901911921931943 unmodified lines19819920020120220320420524 unmodified lines23023123223323423523626 unmodified lines2632642652662672682694 unmodified lines27427527627727827928028188 unmodified lines37037137234537337437537637737824 unmodified lines40340440540640740840941041141241338241441541641741841942042142242342425 unmodified lines4504514524534544554561 unmodified line4584594604614624634644653 unmodified lines46947047147247347443447547647747847948048148248338 unmodified lines52252352452552652752852953011 unmodified lines54254354454554654754854918 unmodified lines56856957057157257357452757557657757857958058158230 unmodified lines6136146156165676176186196206216226236246256266272 unmodified lines63063163263363463563663763863964064164264310 unmodified lines65465565665765865966066166266319 unmodified lines6836846856866876886892 unmodified lines69269369469569669769869919 unmodified lines71972072172272372472572672772872973073173273373473514 unmodified lines7507517527537547557567577587596 unmodified lines766767768769770771772773699774775776777778779# This file was autogenerated by uv via the following command:# uv pip compile pyproject.toml --python 3.10 -o requirements.txtaiofiles==24.1.0 # via gradioaiohappyeyeballs==2.6.1 # via aiohttpaiohttp==3.12.99 unmodified lines # via pydanticanyio==4.9.0 # via # gradio # groq # httpx # openai # starlettearxiv==2.2.0 # via llama-index-readers-papersasttokens==3.0.027 unmodified lines # duckduckgo-search # llama-cloud-services # nltk # typer # uvicorncolorama==0.4.6 # via # click38 unmodified lines # pytestexecuting==2.2.0 # via stack-datafastapi==0.115.13 # via gradiofeedparser==6.0.11 # via arxivffmpy==0.6.0 # via gradiofilelock==3.18.0 # via # huggingface-hub9 unmodified lines # aiosignalfsspec==2025.5.1 # via # gradio-client # huggingface-hub # llama-index-core # torch13 unmodified lines # opentelemetry-exporter-otlp-proto-httpgotrue==2.12.0 # via supabasegradio==5.34.2 # via final-assignment-template (pyproject.toml)gradio-client==1.10.3 # via gradiogreenlet==3.2.3 # via sqlalchemygriffe==1.7.3 # via banksgroovy==0.1.2 # via gradiogroq==0.28.0 # via langchain-groqgrpcio==1.72.14 unmodified linesgrpcio-status==1.71.0 # via google-api-coreh11==0.16.0 # via httpcore # via # httpcore # uvicornh2==4.2.0 # via httpxhf-xet==1.1.37 unmodified lineshttpx==0.28.1 # via # gotrue # gradio # gradio-client # groq # langfuse # langgraph-sdk2 unmodified lines # llama-index-core # openai # postgrest # safehttpx # storage3 # supabase # supafunc3 unmodified lineshuggingface-hub==0.32.4 # via # final-assignment-template (pyproject.toml) # gradio # gradio-client # langchain-huggingface # llama-index-llms-huggingface-api # sentence-transformers24 unmodified linesjinja2==3.1.6 # via # banks # gradio # torchjiter==0.10.0 # via openai26 unmodified lines # langchain-google-genai # langchain-groq # langchain-huggingface # langchain-openai # langchain-text-splitters # langgraph # langgraph-checkpoint4 unmodified lines # via final-assignment-template (pyproject.toml)langchain-huggingface==0.3.0 # via final-assignment-template (pyproject.toml)langchain-openai==0.3.24 # via final-assignment-template (pyproject.toml)langchain-text-splitters==0.3.8 # via langchainlangfuse==3.0.088 unmodified linesmarkdown-it-py==3.0.0 # via richmarkupsafe==3.0.2 # via jinja2 # via # gradio # jinja2marshmallow==3.26.1 # via dataclasses-jsonmatplotlib-inline==0.1.724 unmodified lines # llama-index-corenumpy==2.2.6 # via # gradio # langchain-community # llama-index-core # opencv-python # pandas # scikit-learn # scipy # transformersopenai==1.84.0openai==1.88.0 # via # langchain-openai # llama-index-agent-openai # llama-index-embeddings-openai # llama-index-llms-openaiopencv-python==4.11.0.86 # via final-assignment-template (pyproject.toml)opentelemetry-api==1.34.0 # via # langfuse25 unmodified lines # via opentelemetry-sdkorjson==3.10.18 # via # gradio # langgraph-sdk # langsmithormsgpack==1.10.01 unmodified linepackaging==24.2 # via # deprecation # gradio # gradio-client # huggingface-hub # ipykernel # langchain-core3 unmodified lines # pytest # transformerspandas==2.2.3 # via # final-assignment-template (pyproject.toml) # gradio # via llama-index-readers-file # llama-index-readers-fileparso==0.8.4 # via jedipillow==11.2.1 # via # gradio # llama-index-core # sentence-transformersplatformdirs==4.3.838 unmodified linespydantic==2.11.5 # via # banks # fastapi # gotrue # gradio # groq # langchain # langchain-core11 unmodified lines # via pydanticpydantic-settings==2.9.1 # via langchain-communitypydub==0.25.1 # via gradiopygments==2.19.1 # via # ipython18 unmodified lines # dotenv # llama-cloud-services # pydantic-settingspython-multipart==0.0.20 # via gradiopytz==2025.2 # via pandas# pywin32==310pywin32==310 # via jupyter-corepyyaml==6.0.2 # via # gradio # huggingface-hub # langchain # langchain-community30 unmodified linesrequests-toolbelt==1.0.0 # via langsmithrich==14.0.0 # via # via final-assignment-template (pyproject.toml) # final-assignment-template (pyproject.toml) # typerrsa==4.9.1 # via google-authruff==0.12.0 # via gradiosafehttpx==0.1.6 # via gradiosafetensors==0.5.3 # via transformersscikit-learn==1.7.02 unmodified lines # via # scikit-learn # sentence-transformerssemantic-version==2.10.0 # via gradiosentence-transformers==4.1.0 # via final-assignment-template (pyproject.toml)sgmllib3k==1.0.0 # via feedparsershellingham==1.5.4 # via typersix==1.17.0 # via python-dateutilsniffio==1.3.110 unmodified lines # llama-index-corestack-data==0.6.3 # via ipythonstarlette==0.46.2 # via # fastapi # gradiostorage3==0.11.3 # via supabasestrenum==0.4.1519 unmodified lines # via scikit-learntiktoken==0.9.0 # via # langchain-openai # llama-index-core # tavily-pythontokenizers==0.21.12 unmodified lines # transformerstomli==2.2.1 # via pytesttomlkit==0.13.3 # via gradiotorch==2.7.1 # via sentence-transformerstornado==6.5.119 unmodified lines # matplotlib-inlinetransformers==4.52.4 # via sentence-transformerstyper==0.16.0 # via gradiotyping-extensions==4.14.0 # via # aiosqlite # anyio # beautifulsoup4 # exceptiongroup # fastapi # gradio # gradio-client # groq # huggingface-hub # ipython14 unmodified lines # sentence-transformers # sqlalchemy # torch # typer # typing-inspect # typing-inspection # uvicorntyping-inspect==0.9.0 # via # dataclasses-json6 unmodified lines # via pandasurllib3==2.4.0 # via requestsuvicorn==0.34.3 # via gradiowcwidth==0.2.13 # via prompt-toolkitwebsockets==14.2 # via realtime # via # gradio-client # realtimewidgetsnbextension==4.0.14 # via ipywidgetswikipedia==1.4.01234567891011504 unmodified lines51651751851952052152252323 unmodified lines5475485495505515525535541392 unmodified lines194719481949194119501951195219534 unmodified lines1958195919601952196119621963196422 unmodified lines1987198819891981198219831990199119921993199419955 unmodified lines2001200220031995200420052006200752 unmodified lines206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120821234 unmodified lines33173318331932943320332133223323version = 1revision = 1requires-python = ">=3.13"resolution-markers = [ "sys_platform == 'darwin'", "platform_machine == 'aarch64' and sys_platform == 'linux'", "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')",]
[[package]]name = "aiofiles"504 unmodified lines { name = "llama-index-readers-wikipedia" }, { name = "llama-index-tools-duckduckgo" }, { name = "llama-index-tools-tavily-research" }, { name = "opencv-python" }, { name = "pandas" }, { name = "rich" }, { name = "sentence-transformers" }, { name = "supabase" },23 unmodified lines { name = "llama-index-readers-wikipedia", specifier = ">=0.3.0" }, { name = "llama-index-tools-duckduckgo", specifier = ">=0.3.0" }, { name = "llama-index-tools-tavily-research", specifier = ">=0.3.0" }, { name = "opencv-python", specifier = ">=4.11.0.86" }, { name = "pandas", specifier = ">=2.2.3" }, { name = "rich", specifier = ">=14.0.0" }, { name = "sentence-transformers", specifier = ">=4.1.0" }, { name = "supabase", specifier = ">=2.15.3" },1392 unmodified linesversion = "9.5.1.17"source = { registry = "https://pypi.org/simple" }dependencies = [ { name = "nvidia-cublas-cu12" }, { name = "nvidia-cublas-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },]wheels = [ { url = "https://files.pythonhosted.org/packages/2a/78/4535c9c7f859a64781e43c969a3a7e84c54634e319a996d43ef32ce46f83/nvidia_cudnn_cu12-9.5.1.17-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:30ac3869f6db17d170e0e556dd6cc5eee02647abc31ca856634d5a40f82c15b2", size = 570988386 },4 unmodified linesversion = "11.3.0.4"source = { registry = "https://pypi.org/simple" }dependencies = [ { name = "nvidia-nvjitlink-cu12" }, { name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },]wheels = [ { url = "https://files.pythonhosted.org/packages/8f/16/73727675941ab8e6ffd86ca3a4b7b47065edcca7a997920b831f8147c99d/nvidia_cufft_cu12-11.3.0.4-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ccba62eb9cef5559abd5e0d54ceed2d9934030f51163df018532142a8ec533e5", size = 200221632 },22 unmodified linesversion = "11.7.1.2"source = { registry = "https://pypi.org/simple" }dependencies = [ { name = "nvidia-cublas-cu12" }, { name = "nvidia-cusparse-cu12" }, { name = "nvidia-nvjitlink-cu12" }, { name = "nvidia-cublas-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" }, { name = "nvidia-cusparse-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" }, { name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },]wheels = [ { url = "https://files.pythonhosted.org/packages/f0/6e/c2cf12c9ff8b872e92b4a5740701e51ff17689c4d726fca91875b07f655d/nvidia_cusolver_cu12-11.7.1.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e9e49843a7707e42022babb9bcfa33c29857a93b88020c4e4434656a655b698c", size = 158229790 },5 unmodified linesversion = "12.5.4.2"source = { registry = "https://pypi.org/simple" }dependencies = [ { name = "nvidia-nvjitlink-cu12" }, { name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },]wheels = [ { url = "https://files.pythonhosted.org/packages/06/1e/b8b7c2f4099a37b96af5c9bb158632ea9e5d9d27d7391d7eb8fc45236674/nvidia_cusparse_cu12-12.5.4.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7556d9eca156e18184b94947ade0fba5bb47d69cec46bf8660fd2c71a4b48b73", size = 216561367 },52 unmodified lines { url = "https://files.pythonhosted.org/packages/f4/03/ef68d77a38dd383cbed7fc898857d394d5a8b0520a35f054e7fe05dc3ac1/openai-1.88.0-py3-none-any.whl", hash = "sha256:7edd7826b3b83f5846562a6f310f040c79576278bf8e3687b30ba05bb5dff978", size = 734293 },]
[[package]]name = "opencv-python"version = "4.11.0.86"source = { registry = "https://pypi.org/simple" }dependencies = [ { name = "numpy" },]sdist = { url = "https://files.pythonhosted.org/packages/17/06/68c27a523103dad5837dc5b87e71285280c4f098c60e4fe8a8db6486ab09/opencv-python-4.11.0.86.tar.gz", hash = "sha256:03d60ccae62304860d232272e4a4fda93c39d595780cb40b161b310244b736a4", size = 95171956 }wheels = [ { url = "https://files.pythonhosted.org/packages/05/4d/53b30a2a3ac1f75f65a59eb29cf2ee7207ce64867db47036ad61743d5a23/opencv_python-4.11.0.86-cp37-abi3-macosx_13_0_arm64.whl", hash = "sha256:432f67c223f1dc2824f5e73cdfcd9db0efc8710647d4e813012195dc9122a52a", size = 37326322 }, { url = "https://files.pythonhosted.org/packages/3b/84/0a67490741867eacdfa37bc18df96e08a9d579583b419010d7f3da8ff503/opencv_python-4.11.0.86-cp37-abi3-macosx_13_0_x86_64.whl", hash = "sha256:9d05ef13d23fe97f575153558653e2d6e87103995d54e6a35db3f282fe1f9c66", size = 56723197 }, { url = "https://files.pythonhosted.org/packages/f3/bd/29c126788da65c1fb2b5fb621b7fed0ed5f9122aa22a0868c5e2c15c6d23/opencv_python-4.11.0.86-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b92ae2c8852208817e6776ba1ea0d6b1e0a1b5431e971a2a0ddd2a8cc398202", size = 42230439 }, { url = "https://files.pythonhosted.org/packages/2c/8b/90eb44a40476fa0e71e05a0283947cfd74a5d36121a11d926ad6f3193cc4/opencv_python-4.11.0.86-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b02611523803495003bd87362db3e1d2a0454a6a63025dc6658a9830570aa0d", size = 62986597 }, { url = "https://files.pythonhosted.org/packages/fb/d7/1d5941a9dde095468b288d989ff6539dd69cd429dbf1b9e839013d21b6f0/opencv_python-4.11.0.86-cp37-abi3-win32.whl", hash = "sha256:810549cb2a4aedaa84ad9a1c92fbfdfc14090e2749cedf2c1589ad8359aa169b", size = 29384337 }, { url = "https://files.pythonhosted.org/packages/a4/7d/f1c30a92854540bf789e9cd5dde7ef49bbe63f855b85a2e6b3db8135c591/opencv_python-4.11.0.86-cp37-abi3-win_amd64.whl", hash = "sha256:085ad9b77c18853ea66283e98affefe2de8cc4c1f43eda4c100cf9b2721142ec", size = 39488044 },]
[[package]]name = "opentelemetry-api"version = "1.34.0"1234 unmodified linesversion = "3.3.1"source = { registry = "https://pypi.org/simple" }dependencies = [ { name = "setuptools" }, { name = "setuptools", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },]wheels = [ { url = "https://files.pythonhosted.org/packages/74/1f/dfb531f90a2d367d914adfee771babbd3f1a5b26c3f5fbc458dee21daa78/triton-3.3.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b89d846b5a4198317fec27a5d3a609ea96b6d557ff44b56c23176546023c4240", size = 155673035 },README.md+7-1
__pycache__/code_agent.cpython-313.pyc
__pycache__/langraph_agent.cpython-313.pyc
code_agent.py+20-1
pyproject.toml+2
requirements.txt+84-7
uv.lock+33-7