更新了langgraph-plan-view,支持windows下使用 langgraph cli;更新了langgraph-vivado-install,要求安装langgraph cli,确定conda环境的名称为langgraph

This commit is contained in:
Myfro9
2026-05-25 13:13:00 +08:00
parent fda6c9a114
commit 48b965ec4e
9 changed files with 980 additions and 145 deletions
+90 -5
View File
@@ -114,16 +114,40 @@ conda env list | grep "^langgraph"
```
### 2b. 安装所需 Python 包
一条命令安装全部依赖(包含 `/langgraph-plan-review` skill 所需包):
```bash
conda run -n langgraph pip install langgraph langchain-anthropic pandas
conda run -n langgraph pip install \
langgraph \
langchain-anthropic \
pandas \
"langgraph-cli[inmem]" \
langgraph-sdk \
httpx \
langgraph-checkpoint-sqlite
```
> **为什么这些包?**
> | 包 | 用途 |
> |---|---|
> | `langgraph` | 核心图执行引擎 |
> | `langchain-anthropic` | Anthropic LLM 集成 |
> | `pandas` | 数据处理 |
> | `langgraph-cli[inmem]` | 提供 `langgraph dev` 服务器命令(`/langgraph-plan-review` 必需) |
> | `langgraph-sdk` | `run_workflow.py` 通过 SDK 向 dev server 提交 run(`/langgraph-plan-review` 必需) |
> | `httpx` | `run_workflow.py` 健康检查(`/langgraph-plan-review` 必需) |
> | `langgraph-checkpoint-sqlite` | dev server 状态持久化(`/langgraph-plan-review` 必需) |
验证安装:
```bash
conda run -n langgraph python -c "import langgraph; print('LangGraph OK:', langgraph.__version__)"
conda run -n langgraph python -c "from langgraph_sdk import get_sync_client; print('langgraph-sdk OK')"
conda run -n langgraph python -c "import httpx; print('httpx OK')"
conda run -n langgraph langgraph --version
```
若导入失败,报告错误并停止,请用户检查网络或 pip 源配置。
若任一导入失败,报告错误并停止,请用户检查网络或 pip 源配置。
---
@@ -273,7 +297,15 @@ conda run -n langgraph vivado -version
"VIVADO_BIN_PATH": "<Step 3 确认的 Windows 格式路径>",
"conda_env": "langgraph",
"python_version": "3.11",
"packages": ["langgraph", "langchain-anthropic", "pandas"]
"packages": [
"langgraph",
"langchain-anthropic",
"pandas",
"langgraph-cli[inmem]",
"langgraph-sdk",
"httpx",
"langgraph-checkpoint-sqlite"
]
}
```
@@ -302,6 +334,55 @@ def test_langgraph():
return False
def test_langgraph_plan_review_deps():
"""Verify packages required by the /langgraph-plan-review skill."""
ok = True
checks = [
("langgraph_sdk", "from langgraph_sdk import get_sync_client"),
("httpx", "import httpx"),
("langgraph_checkpoint_sqlite", "from langgraph.checkpoint.sqlite import SqliteSaver"),
]
for name, stmt in checks:
try:
exec(stmt)
import importlib.metadata
try:
ver = importlib.metadata.version(name.replace("_", "-"))
print(f"[OK] {name} OK (version: {ver})")
except importlib.metadata.PackageNotFoundError:
print(f"[OK] {name} importable")
except Exception as e:
print(f"[FAIL] {name}: {e}")
ok = False
# Check langgraph dev CLI
try:
result = subprocess.run(
[sys.executable, "-m", "langgraph", "--version"],
capture_output=True, text=True, timeout=10
)
if result.returncode == 0:
print(f"[OK] langgraph-cli OK: {result.stdout.strip() or result.stderr.strip()}")
else:
# Try via entry point script
import shutil
lg = shutil.which("langgraph")
if lg:
r2 = subprocess.run([lg, "--version"], capture_output=True, text=True, timeout=10)
if r2.returncode == 0:
print(f"[OK] langgraph dev CLI OK: {r2.stdout.strip()}")
else:
print(f"[WARN] langgraph CLI found but --version failed: {r2.stderr.strip()}")
else:
print("[FAIL] langgraph CLI not found on PATH — install: pip install 'langgraph-cli[inmem]'")
ok = False
except Exception as e:
print(f"[FAIL] langgraph CLI check error: {e}")
ok = False
return ok
def test_vivado():
config_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "env_config.json")
env = os.environ.copy()
@@ -342,10 +423,14 @@ if __name__ == "__main__":
print("LangGraph + Vivado smoke test")
print("=" * 50)
ok_lg = test_langgraph()
print("-" * 50)
print("langgraph-plan-review deps:")
ok_pr = test_langgraph_plan_review_deps()
print("-" * 50)
ok_vv = test_vivado()
print("=" * 50)
if ok_lg and ok_vv:
print("[PASS] All checks passed. LangGraph + Vivado pipeline OK!")
if ok_lg and ok_pr and ok_vv:
print("[PASS] All checks passed. LangGraph + Vivado + plan-review pipeline OK!")
sys.exit(0)
else:
print("[FAIL] Some checks failed. See above.")