#!/usr/bin/env python3 # -*- coding: utf-8 -*- """打印 AgentThought 类定义附近字段(tool_meta/tools/observation)。""" from __future__ import annotations import sys import _bootstrap # noqa: F401 import _config as C from dify_api import Dify def main() -> int: d = Dify(C.DIFY_EMAIL, C.DIFY_PASSWORD) try: d.login() cmd = ( "docker exec docker-api-1 sh -lc " "\"grep -RIn --line-number 'class AgentThought' /app/api/core /app/api/models 2>/dev/null | head -20\"" ) out, err = d.sh(cmd, t=240) print(out or err) return 0 finally: d.close() if __name__ == '__main__': sys.exit(main())