Files
AgentLab/backend/requirements.lock
T
ThearchyHelios 2e7d6103ea 应用库可移植到 PostgreSQL:AGENTLAB_DATABASE_URL 设成 postgresql+asyncpg://… 时整个应用库用 PostgreSQL,断点用官方的 langgraph-checkpoint-postgres(同一个库,AGENTLAB_CHECKPOINT_URL 可另给);不设时照旧是数据目录里的 SQLite,行为不变
- 配置:database_url、checkpoint_url(启动时校验写法,只认 PostgreSQL)、连接池四项;启动日志写用的是哪种库(主机、库名、用户,不写密码)
- 引擎(db/base.make_engine):SQLite 照旧 WAL、外键、忙等;PostgreSQL 用连接池、探活、会话时区 UTC,装上方言调整(db/postgres.py):建表时 String(n) 是不限长的 VARCHAR(SQLite 从不查长度,导过来的存量也可能超长)、ORDER BY 里可空列的 NULL 位置照 SQLite 补写(升序在前、降序在后,窗口函数里同样);Integer 列在 PostgreSQL 上是 BIGINT(列挂到表上时换成 with_variant,绑定参数跟着列按 BIGINT 转换);JSON 列两边都存原文(PostgreSQL 的 json,不用 JSONB:JSONB 重排对象里的键,快照的列序、表的先后读回来就变了);JSON 里的 NaN 写成 null、NUL 去掉(PostgreSQL 不收)
- 迁移按方言:已有的列和索引用 inspector 认;PostgreSQL 上补列的类型取模型里这一列的、缺省值取迁移表里的(布尔 0/1 换成 false/true),ADD COLUMN IF NOT EXISTS;去重语句里的布尔按方言写;部分唯一索引补 postgresql_where;init_db 在 PostgreSQL 上拿咨询锁(几个进程同时启动不撞)
- 应用库上的 SQLite 专用写法改成按方言编译的表达式(db/portable.py):json_extract 的十几处(口径召回、出具、对账、个人应用、幂等键、访问控制、数据源变化通知、剖析任务、待办超时)换成 json_eq / json_flag / json_text,json_type 换成 json_is_string(两种库同一套带类型的比较);能力登记的 sqlite insert 换成按会话方言的 insert_ignore;能力使用次数的 json_each 按方言分支;附件「没绑记录」的条件不靠 json 的等号;按报错文字认唯一约束的地方换成 unique_violation(按表和列认,两种库的报错都认得)
- 断点(engine/checkpoints.py):PostgreSQL 时开 psycopg 连接池、在咨询锁里 setup;runner 只认 BaseCheckpointSaver,读断点仍只走 saver 的公开接口
- 依赖:新 extra postgres(asyncpg、psycopg[binary] 3、psycopg-pool、langgraph-checkpoint-postgres 3.1.2);langgraph-checkpoint 卡在 <4.3(断点格式就在这个包里,postgres 包新版要 4.3,不动已装的 4.2.0);锁文件补上新包
- 运行收尾:记 action.unknown、安排核实做完才把运行摘掉(以前先摘掉,等「不在跑了」再读事件的一方在库慢时读不到这一条)
- 测试:AGENTLAB_TEST_DATABASE_URL 时跑在 PostgreSQL 上(每个 xdist 进程建自己的库、按事件循环分的连接池 tests/pgpool.py),不设时盖掉环境里的数据库地址照旧用 SQLite;scripts/test-postgres.sh 起临时的 postgres:16 容器跑全量;sqlite_only 标记;另开连接改库的几个竞态测试、触发器测试改成两种库都能跑(tests/appdb.py);新增 test_db_portable 守着方言调整、JSON 键序、超长字符串、大整数、NULL 排序、时区、PostgreSQL 老库迁移
2026-10-19 09:52:09 +08:00

358 lines
7.7 KiB
Plaintext

# This file was autogenerated by uv via the following command:
# ./scripts/lock-deps.sh
aiomysql==0.3.2
# via agentlab-backend (pyproject.toml)
aiosqlite==0.22.1
# via
# agentlab-backend (pyproject.toml)
# langgraph-checkpoint-sqlite
annotated-doc==0.0.5
# via fastapi
annotated-types==0.8.0
# via pydantic
anthropic==1.5.0
# via langchain-anthropic
anyio==4.15.1
# via
# anthropic
# httpx
# httpx2
# langsmith
# mcp
# openai
# sse-starlette
# starlette
# watchfiles
asyncpg==0.31.0
# via agentlab-backend (pyproject.toml)
attrs==26.1.0
# via
# jsonschema
# referencing
beautifulsoup4==4.15.0
# via agentlab-backend (pyproject.toml)
certifi==2026.7.22
# via
# httpcore
# httpx
# langchain-openai
# requests
cffi==2.1.1 ; platform_python_implementation != 'PyPy'
# via cryptography
charset-normalizer==3.5.1
# via requests
click==8.5.0
# via uvicorn
colorama==0.4.6 ; sys_platform == 'win32'
# via pytest
cryptography==50.0.1
# via
# agentlab-backend (pyproject.toml)
# oracledb
# pyjwt
distro==1.9.0
# via langsmith
docstring-parser==0.18.0
# via anthropic
et-xmlfile==2.0.0
# via openpyxl
execnet==2.1.2
# via pytest-xdist
fastapi==0.141.1
# via agentlab-backend (pyproject.toml)
greenlet==3.5.5
# via
# agentlab-backend (pyproject.toml)
# sqlalchemy
h11==0.16.0
# via
# httpcore
# httpcore2
# uvicorn
httpcore==1.0.9
# via httpx
httpcore2==2.12.0 ; sys_platform != 'emscripten'
# via httpx2
httptools==0.8.0
# via uvicorn
httpx==0.28.1
# via
# agentlab-backend (pyproject.toml)
# langchain-core
# langgraph-sdk
# mcp
httpx-sse==0.4.3
# via mcp
httpx2==2.12.0
# via
# anthropic
# langsmith
# openai
httpx2-jsfetch==1.0 ; sys_platform == 'emscripten'
# via httpx2
idna==3.19
# via
# anyio
# httpx
# httpx2
# requests
iniconfig==2.3.0
# via pytest
jiter==0.17.0
# via
# anthropic
# openai
jsonpatch==1.33
# via langchain-core
jsonpointer==3.1.1
# via jsonpatch
jsonschema==4.26.0
# via
# agentlab-backend (pyproject.toml)
# mcp
jsonschema-specifications==2025.9.1
# via jsonschema
langchain-anthropic==1.7.2
# via agentlab-backend (pyproject.toml)
langchain-core==1.6.3
# via
# agentlab-backend (pyproject.toml)
# langchain-anthropic
# langchain-mcp-adapters
# langchain-openai
# langgraph
# langgraph-checkpoint
# langgraph-prebuilt
# langgraph-sdk
langchain-mcp-adapters==0.3.2
# via agentlab-backend (pyproject.toml)
langchain-openai==1.6.2
# via agentlab-backend (pyproject.toml)
langchain-protocol==0.0.19
# via
# langchain-core
# langgraph-sdk
langgraph==1.2.11
# via agentlab-backend (pyproject.toml)
langgraph-checkpoint==4.2.0
# via
# agentlab-backend (pyproject.toml)
# langgraph
# langgraph-checkpoint-postgres
# langgraph-checkpoint-sqlite
# langgraph-prebuilt
langgraph-checkpoint-postgres==3.1.2
# via agentlab-backend (pyproject.toml)
langgraph-checkpoint-sqlite==3.1.1
# via agentlab-backend (pyproject.toml)
langgraph-prebuilt==1.1.0
# via langgraph
langgraph-sdk==0.4.4
# via langgraph
langsmith==0.12.4
# via langchain-core
lxml==6.1.3
# via
# python-docx
# python-pptx
mcp==1.30.0
# via
# agentlab-backend (pyproject.toml)
# langchain-mcp-adapters
microsandbox==0.6.18
# via agentlab-backend (pyproject.toml)
numpy==2.5.3
# via agentlab-backend (pyproject.toml)
openai==3.13.0
# via langchain-openai
openpyxl==3.1.5
# via agentlab-backend (pyproject.toml)
oracledb==26.0.0
# via agentlab-backend (pyproject.toml)
orjson==3.12.0
# via
# langgraph-checkpoint-postgres
# langgraph-sdk
# langsmith
ormsgpack==1.12.2
# via langgraph-checkpoint
packaging==26.3
# via
# langchain-core
# langsmith
# pytest
pillow==12.3.0
# via python-pptx
pluggy==1.6.0
# via pytest
psycopg==3.3.6
# via
# agentlab-backend (pyproject.toml)
# langgraph-checkpoint-postgres
psycopg-binary==3.3.6 ; implementation_name != 'pypy'
# via psycopg
psycopg-pool==3.3.3
# via
# agentlab-backend (pyproject.toml)
# langgraph-checkpoint-postgres
pycparser==3.0 ; implementation_name != 'PyPy' and platform_python_implementation != 'PyPy'
# via cffi
pydantic==2.13.5
# via
# agentlab-backend (pyproject.toml)
# anthropic
# fastapi
# langchain-anthropic
# langchain-core
# langgraph
# langsmith
# mcp
# openai
# pydantic-settings
pydantic-core==2.46.5
# via pydantic
pydantic-settings==2.15.0
# via
# agentlab-backend (pyproject.toml)
# mcp
pygments==2.21.0
# via pytest
pyjwt==2.14.0
# via mcp
pymysql==1.2.0
# via aiomysql
pypdf==6.19.0
# via agentlab-backend (pyproject.toml)
pytest==9.1.1
# via
# agentlab-backend (pyproject.toml)
# pytest-asyncio
# pytest-xdist
pytest-asyncio==1.4.0
# via agentlab-backend (pyproject.toml)
pytest-xdist==3.8.0
# via agentlab-backend (pyproject.toml)
python-docx==1.2.0
# via agentlab-backend (pyproject.toml)
python-dotenv==1.2.3
# via
# pydantic-settings
# uvicorn
python-multipart==0.0.32
# via
# agentlab-backend (pyproject.toml)
# mcp
python-pptx==1.0.2
# via agentlab-backend (pyproject.toml)
pywin32==312 ; sys_platform == 'win32'
# via mcp
pyyaml==6.0.3
# via
# langchain-core
# uvicorn
referencing==0.37.0
# via
# jsonschema
# jsonschema-specifications
regex==2026.9.10
# via tiktoken
requests==2.34.2
# via
# langsmith
# requests-toolbelt
# tiktoken
requests-toolbelt==1.0.0
# via langsmith
rpds-py==2026.6.3
# via
# jsonschema
# referencing
sniffio==1.3.1
# via
# anthropic
# langsmith
# openai
soupsieve==2.9.2
# via beautifulsoup4
sqlalchemy==2.0.52
# via agentlab-backend (pyproject.toml)
sqlglot==30.21.0
# via agentlab-backend (pyproject.toml)
sqlite-vec==0.1.9
# via langgraph-checkpoint-sqlite
sse-starlette==3.4.11
# via mcp
starlette==1.6.0
# via
# fastapi
# mcp
# sse-starlette
tenacity==9.1.4
# via langchain-core
tiktoken==0.14.0
# via langchain-openai
truststore==0.10.4 ; sys_platform != 'emscripten'
# via
# httpcore2
# httpx2
typing-extensions==4.16.0
# via
# anthropic
# anyio
# beautifulsoup4
# fastapi
# httpx2
# langchain-core
# langchain-mcp-adapters
# langchain-protocol
# langsmith
# mcp
# openai
# oracledb
# psycopg
# psycopg-pool
# pydantic
# pydantic-core
# pytest-asyncio
# python-docx
# python-pptx
# referencing
# sqlalchemy
# starlette
# typing-inspection
typing-inspection==0.4.4
# via
# fastapi
# mcp
# pydantic
# pydantic-settings
tzdata==2026.5 ; sys_platform == 'win32'
# via psycopg
urllib3==2.7.0
# via requests
uuid-utils==0.17.1
# via
# langchain-core
# langsmith
uvicorn==0.52.4
# via
# agentlab-backend (pyproject.toml)
# mcp
uvloop==0.22.1 ; platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32'
# via uvicorn
watchfiles==1.2.0
# via uvicorn
websockets==16.1.1
# via
# langgraph-sdk
# langsmith
# uvicorn
xlsxwriter==3.2.9
# via python-pptx
xxhash==4.0.1
# via
# langgraph
# langsmith
zstandard==0.25.0
# via langsmith