from dify_api import Dify, pp import json d = Dify("38205036@qq.com", "Difyai123456") d.login() # 1) 工作区已安装的工具 provider(DifyShellLayer 应出现在列表里) for path in ( "/workspaces/current/tools/builtin", "/workspaces/current/tool-providers", "/workspaces/current/tools", ): r = d.get(path) print("GET", path, "HTTP", r["code"], (r["text"] or "")[:300]) # 2) 新 Agent 真正生效的是快照,不是旧版 model_config out, err = d.sh( "docker exec docker-db_postgres-1 psql -U postgres -d dify -t -A -c " "\"SELECT config_snapshot::json -> 'tools' " "FROM agent_config_snapshots " "WHERE id='01a0135c-320e-79dc-97a0-94da9b904c13'\"" ) print("snapshot.tools", out or err) d.close()