sycommon-python-lib 0.2.5a27__tar.gz → 0.2.5a29__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/PKG-INFO +7 -7
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/pyproject.toml +7 -7
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/deep_agent.py +383 -12
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/multi_agent_team.py +18 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/llm_with_token_tracking.py +8 -55
- sycommon_python_lib-0.2.5a29/src/sycommon/llm/token_utils.py +96 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/usage_token.py +8 -46
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon_python_lib.egg-info/PKG-INFO +7 -7
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon_python_lib.egg-info/SOURCES.txt +1 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon_python_lib.egg-info/requires.txt +6 -6
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/README.md +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/setup.cfg +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/cli.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/core/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/core/console.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/core/models.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/core/project.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/core/utils.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/README.md.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/agent/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/agent/main_agent.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/agent/nodes/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/agent/nodes/example_node.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/agent/states/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/agent/states/agent_state.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/api/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/api/query.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/api/sse/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/api/sse/agent.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/app.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/client/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/db/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/db/model/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/db/model/entity.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/db/service.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/model/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/model/parse.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/tools/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/agent/tools/mq.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/.env.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/.gitignore.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/Dockerfile.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/README.md.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/app.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/app.yaml.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/client/FileServiceClient.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/client/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/model/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/model/file_info.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/base/requirements.txt.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/cli/README.md.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/cli/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/cli/app.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/cli/commands/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/cli/commands/hello.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/cli/pyproject.toml.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/cli/tools/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/README.md.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/api/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/api/echo.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/api/sse/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/api/sse/echo.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/app.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/client/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/model/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/tools/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/command/templates/web/tools/mq.py.tpl +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/nexus/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/__main__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/agents/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/agents/factory.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/agents/prompts.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/browser.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/capabilities/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/capabilities/console.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/capabilities/dom.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/capabilities/network.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/capabilities/page_errors.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/capabilities/performance.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/capabilities/screenshot.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/client.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/protocol.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cdp/repl.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/cli.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/commands/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/commands/cdp_cmd.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/commands/chat_cmd.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/commands/create_cmd.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/commands/evaluate_cmd.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/commands/init_cmd.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/commands/memory_cmd.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/commands/resume_cmd.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/commands/rollback_cmd.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/commands/run_cmd.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/core/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/core/backend.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/core/config.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/core/display.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/core/git_integration.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/core/llm.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/core/state.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/evaluate/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/evaluate/api_evaluator.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/memory/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/memory/compressor.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/memory/full.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/memory/hot.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/memory/manager.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/memory/warm.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/mode/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/mode/create.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/mode/optimize.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/models/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/models/config_models.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/baseline_tests.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/checkpoint.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/convergence.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/diagnosis.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/engine.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/environment.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/experience.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/harness_prompts.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/history.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/optimization_logger.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/pre_validation.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/reward.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/strategy_bandit.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/strategy_generator.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/rl/strategy_prompts.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycli/skills/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/agent_manager.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/chat_events.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/mcp/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/mcp/models.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/mcp/tool_loader.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/sandbox/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/sandbox/file_ops.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/sandbox/http_sandbox_backend.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/sandbox/minio_sync.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/sandbox/sandbox_pool.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/sandbox/sandbox_recovery.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/sandbox/session.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/summarization_utils.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/auth/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/auth/ldap_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/auth/oa_cache.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/auth/oa_crypto.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/auth/oa_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/auth/wecom_ldap_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/Config.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/DatabaseConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/ElasticsearchConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/EmbeddingConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/LLMConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/LangfuseConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/MQConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/PgConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/RedisConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/RerankerConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/SentryConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/XxlJobConfig.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/config/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/database/async_base_db_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/database/async_database_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/database/base_db_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/database/database_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/database/elasticsearch_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/database/pg_checkpoint_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/database/redis_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/database/token_usage_db_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/health/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/health/health_check.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/health/metrics.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/health/ping.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/heartbeat_process/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/heartbeat_process/heartbeat_config.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/heartbeat_process/heartbeat_process_manager.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/heartbeat_process/heartbeat_process_worker.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/embedding.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/get_llm.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/llm_logger.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/llm_tokens.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/native_with_fallback_runnable.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/output_fixing_runnable.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/struct_token.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/sy_langfuse.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/tiktoken_cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4 +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/tiktoken_cache/fb374d419588a4632f3f557e76b4b70aebbca790 +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/token_usage_es_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/llm/token_usage_mysql_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/logging/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/logging/async_sql_logger.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/logging/kafka_log.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/logging/logger_levels.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/logging/logger_wrapper.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/logging/process_logger.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/logging/sql_logger.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/mcp_server/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/mcp_server/server.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/context.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/cors.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/docs.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/exception.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/middleware.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/monitor_memory.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/mq.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/sandbox.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/timeout.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/token_tracking.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/tool_result_truncation.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/middleware/traceid.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/base_http.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/log.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/mcp_server_config.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/mqlistener_config.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/mqmsg_model.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/mqsend_config.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/sandbox.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/sso_user.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/token_usage.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/token_usage_mysql.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/models/xxljob_handler_config.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/notice/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/notice/uvicorn_monitor.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/notice/wecom_message.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/rabbitmq/process_pool_consumer.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/rabbitmq/rabbitmq_client.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/rabbitmq/rabbitmq_pool.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/rabbitmq/rabbitmq_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/rabbitmq/rabbitmq_service_client_manager.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/rabbitmq/rabbitmq_service_connection_monitor.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/rabbitmq/rabbitmq_service_consumer_manager.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/rabbitmq/rabbitmq_service_core.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/rabbitmq/rabbitmq_service_producer_manager.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/sentry/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/sentry/sy_sentry.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/services.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/sse/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/sse/event.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/sse/sse.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/example.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/example2.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/feign.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/feign_client.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/nacos_client_base.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/nacos_config_manager.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/nacos_heartbeat_manager.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/nacos_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/nacos_service_discovery.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/nacos_service_registration.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/synacos/param.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/deep_agent_server.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_consumer_recovery.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_deep_agent.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_dynamic_max_tokens.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_email.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_encoding_cache.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_mcp_server.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_minimax_reasoning.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_mq.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_oa_login.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_real_summarization.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_summarization_config.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tests/test_summarization_real.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tools/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tools/async_utils.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tools/docs.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tools/env.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tools/merge_headers.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tools/snowflake.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tools/syemail.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/tools/timing.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/xxljob/__init__.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/xxljob/xxljob_service.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon_python_lib.egg-info/dependency_links.txt +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon_python_lib.egg-info/entry_points.txt +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon_python_lib.egg-info/top_level.txt +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/tests/test_asyncio_logging.py +0 -0
- {sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/tests/test_sycli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sycommon-python-lib
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5a29
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -9,15 +9,15 @@ Requires-Dist: aiohttp==3.13.5
|
|
|
9
9
|
Requires-Dist: aiomysql==0.3.2
|
|
10
10
|
Requires-Dist: anyio==4.13.0
|
|
11
11
|
Requires-Dist: decorator==5.3.1
|
|
12
|
-
Requires-Dist: deepagents==0.6.
|
|
12
|
+
Requires-Dist: deepagents==0.6.7
|
|
13
13
|
Requires-Dist: elasticsearch==9.4.1
|
|
14
14
|
Requires-Dist: fastapi==0.136.3
|
|
15
15
|
Requires-Dist: jinja2==3.1.6
|
|
16
16
|
Requires-Dist: kafka-python==2.3.1
|
|
17
17
|
Requires-Dist: langchain==1.3.2
|
|
18
18
|
Requires-Dist: langchain-core==1.4.0
|
|
19
|
-
Requires-Dist: langchain-openai==1.2.
|
|
20
|
-
Requires-Dist: langfuse==4.
|
|
19
|
+
Requires-Dist: langchain-openai==1.2.2
|
|
20
|
+
Requires-Dist: langfuse==4.7.1
|
|
21
21
|
Requires-Dist: langgraph==1.2.2
|
|
22
22
|
Requires-Dist: langgraph-checkpoint-postgres==3.1.0
|
|
23
23
|
Requires-Dist: langgraph-checkpoint-redis==0.4.1
|
|
@@ -29,12 +29,12 @@ Requires-Dist: psutil==7.2.2
|
|
|
29
29
|
Requires-Dist: pyxxl==0.4.7
|
|
30
30
|
Requires-Dist: pydantic==2.13.4
|
|
31
31
|
Requires-Dist: python-dotenv==1.2.2
|
|
32
|
-
Requires-Dist: python-multipart==0.0.
|
|
32
|
+
Requires-Dist: python-multipart==0.0.30
|
|
33
33
|
Requires-Dist: pyyaml==6.0.3
|
|
34
34
|
Requires-Dist: redis==7.4.0
|
|
35
|
-
Requires-Dist: sentry-sdk[fastapi]==2.
|
|
35
|
+
Requires-Dist: sentry-sdk[fastapi]==2.61.1
|
|
36
36
|
Requires-Dist: sqlalchemy[asyncio]==2.0.50
|
|
37
|
-
Requires-Dist: starlette[full]==1.1
|
|
37
|
+
Requires-Dist: starlette[full]==1.2.1
|
|
38
38
|
Requires-Dist: tiktoken==0.13.0
|
|
39
39
|
Requires-Dist: uvicorn==0.48.0
|
|
40
40
|
Requires-Dist: wecom-aibot-python-sdk==1.0.2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sycommon-python-lib"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.5a29"
|
|
4
4
|
description = "Add your description here"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -10,15 +10,15 @@ dependencies = [
|
|
|
10
10
|
"aiomysql==0.3.2",
|
|
11
11
|
"anyio==4.13.0",
|
|
12
12
|
"decorator==5.3.1",
|
|
13
|
-
"deepagents==0.6.
|
|
13
|
+
"deepagents==0.6.7",
|
|
14
14
|
"elasticsearch==9.4.1",
|
|
15
15
|
"fastapi==0.136.3",
|
|
16
16
|
"jinja2==3.1.6",
|
|
17
17
|
"kafka-python==2.3.1",
|
|
18
18
|
"langchain==1.3.2",
|
|
19
19
|
"langchain-core==1.4.0",
|
|
20
|
-
"langchain-openai==1.2.
|
|
21
|
-
"langfuse==4.
|
|
20
|
+
"langchain-openai==1.2.2",
|
|
21
|
+
"langfuse==4.7.1",
|
|
22
22
|
"langgraph==1.2.2",
|
|
23
23
|
"langgraph-checkpoint-postgres==3.1.0",
|
|
24
24
|
"langgraph-checkpoint-redis==0.4.1",
|
|
@@ -30,12 +30,12 @@ dependencies = [
|
|
|
30
30
|
"pyxxl==0.4.7",
|
|
31
31
|
"pydantic==2.13.4",
|
|
32
32
|
"python-dotenv==1.2.2",
|
|
33
|
-
"python-multipart==0.0.
|
|
33
|
+
"python-multipart==0.0.30",
|
|
34
34
|
"pyyaml==6.0.3",
|
|
35
35
|
"redis==7.4.0",
|
|
36
|
-
"sentry-sdk[fastapi]==2.
|
|
36
|
+
"sentry-sdk[fastapi]==2.61.1",
|
|
37
37
|
"sqlalchemy[asyncio]==2.0.50",
|
|
38
|
-
"starlette[full]==1.1
|
|
38
|
+
"starlette[full]==1.2.1",
|
|
39
39
|
"tiktoken==0.13.0",
|
|
40
40
|
"uvicorn==0.48.0",
|
|
41
41
|
"wecom-aibot-python-sdk==1.0.2",
|
{sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/deep_agent.py
RENAMED
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
import asyncio
|
|
38
38
|
import json
|
|
39
39
|
import os
|
|
40
|
+
from collections.abc import Awaitable, Callable
|
|
40
41
|
from pathlib import Path
|
|
41
|
-
from typing import Any, AsyncGenerator,
|
|
42
|
+
from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, TYPE_CHECKING
|
|
42
43
|
|
|
43
44
|
from pydantic import BaseModel, Field
|
|
44
|
-
from langchain_core.messages import HumanMessage, BaseMessage
|
|
45
|
+
from langchain_core.messages import HumanMessage, BaseMessage, AIMessageChunk, AIMessage, SystemMessage
|
|
45
46
|
from langchain_core.tools import BaseTool, tool
|
|
46
47
|
|
|
47
48
|
from sycommon.logging.kafka_log import SYLogger
|
|
@@ -56,6 +57,202 @@ from sycommon.agent.summarization_utils import build_summarization_middleware
|
|
|
56
57
|
|
|
57
58
|
if TYPE_CHECKING:
|
|
58
59
|
from deepagents.graph import CompiledStateGraph
|
|
60
|
+
from langchain.agents.middleware.types import AgentState, ContextT, ModelRequest, ModelResponse, ResponseT
|
|
61
|
+
from langgraph.runtime import Runtime
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _patch_agent_streaming(agent):
|
|
65
|
+
"""Monkey-patch factory.py _execute_model_async to fix stream_mode="messages".
|
|
66
|
+
|
|
67
|
+
根因: langchain factory.py (<=1.3.2) 的 _execute_model_async 有两个问题:
|
|
68
|
+
1. 调用 model_.ainvoke(messages) 不传 config → callbacks 不传播
|
|
69
|
+
2. 使用 ainvoke (非流式) 而非 astream → on_llm_new_token 不触发
|
|
70
|
+
|
|
71
|
+
修复: 替换 amodel_node 闭包中的 _execute_model_async, 改用 astream 并传入
|
|
72
|
+
从 ContextVar 读取的 config。astream 每个 token 触发 on_llm_new_token,
|
|
73
|
+
StreamMessagesHandler 拦截后推送给 stream_mode="messages" 的消费者。
|
|
74
|
+
|
|
75
|
+
为什么是最内层替换(而非 Middleware): _execute_model_async 位于所有中间件
|
|
76
|
+
(含 deepagents tail 的 MemoryMiddleware/FilesystemMiddleware 等会 modify_request
|
|
77
|
+
的 awrap_model_call)的最内层。替换它不绕过任何中间件; 用 Middleware 方案则只能
|
|
78
|
+
插在"用户中间件"层, 会绕过更内层的 MemoryMiddleware 注入。故保留 monkey-patch。
|
|
79
|
+
|
|
80
|
+
加固: 闭包结构按"自由变量名"定位 cell(不依赖固定索引), 任一不符即跳过 patch
|
|
81
|
+
并降级为非流式(功能正常, 只是不逐 token 推送), 而非打错补丁导致静默失效。
|
|
82
|
+
|
|
83
|
+
TODO: 等官方修复 (langchain >1.3.x, _execute_model_async 改用 astream) 后
|
|
84
|
+
删除此函数及调用即可。
|
|
85
|
+
"""
|
|
86
|
+
# 已验证兼容的版本范围(超出仅警告, 不阻断 —— 闭包强校验是真正的安全网)
|
|
87
|
+
_VERIFIED = {"langchain": "1.3.2", "langchain_core": "1.4.0"}
|
|
88
|
+
try:
|
|
89
|
+
import langchain as _lc
|
|
90
|
+
import langchain_core as _lcc
|
|
91
|
+
_cur = {"langchain": getattr(_lc, "__version__", "?"),
|
|
92
|
+
"langchain_core": getattr(_lcc, "__version__", "?")}
|
|
93
|
+
if _cur != _VERIFIED:
|
|
94
|
+
SYLogger.warning(
|
|
95
|
+
f"[StreamingPatch] langchain 版本 {_cur} 与已验证 {_VERIFIED} 不一致; "
|
|
96
|
+
f"闭包强校验仍会兜底, 但建议复核 _execute_model_async 是否已改用 astream")
|
|
97
|
+
except Exception:
|
|
98
|
+
pass
|
|
99
|
+
|
|
100
|
+
try:
|
|
101
|
+
from langchain_core.messages import AIMessageChunk as _AIC, AIMessage as _AIM
|
|
102
|
+
from langchain_core.runnables.config import var_child_runnable_config
|
|
103
|
+
|
|
104
|
+
print(f"[StreamingPatch] agent.nodes: {list(agent.nodes.keys())}", flush=True)
|
|
105
|
+
node = agent.nodes.get("model")
|
|
106
|
+
if node is None:
|
|
107
|
+
print("[StreamingPatch] model node not found, skip", flush=True)
|
|
108
|
+
SYLogger.warning("[DeepAgent] model node not found, skip streaming patch")
|
|
109
|
+
return
|
|
110
|
+
|
|
111
|
+
inner = node.node # RunnableSeq
|
|
112
|
+
print(f"[StreamingPatch] inner type: {type(inner).__name__}", flush=True)
|
|
113
|
+
if not hasattr(inner, 'steps') or not inner.steps:
|
|
114
|
+
print(f"[StreamingPatch] no steps, inner={inner}", flush=True)
|
|
115
|
+
SYLogger.warning("[DeepAgent] model node has no steps, skip streaming patch")
|
|
116
|
+
return
|
|
117
|
+
|
|
118
|
+
step0 = inner.steps[0] # RunnableCallable(trace=False, afunc=amodel_node)
|
|
119
|
+
print(f"[StreamingPatch] step0 type: {type(step0).__name__}, trace={getattr(step0, 'trace', 'N/A')}", flush=True)
|
|
120
|
+
afunc = getattr(step0, "afunc", None) # amodel_node
|
|
121
|
+
if afunc is None or afunc.__closure__ is None:
|
|
122
|
+
SYLogger.warning("[DeepAgent] amodel_node afunc/closure 缺失, skip streaming patch")
|
|
123
|
+
return
|
|
124
|
+
print(f"[StreamingPatch] afunc: {afunc.__name__}, freevars={afunc.__code__.co_freevars}", flush=True)
|
|
125
|
+
|
|
126
|
+
# ---- 按自由变量名定位 cell(不依赖固定索引)----
|
|
127
|
+
def _cell_by_name(fn, name):
|
|
128
|
+
"""从闭包函数 fn 中按 co_freevars 名取出对应 cell 对象(取不到返回 None)。"""
|
|
129
|
+
names = fn.__code__.co_freevars
|
|
130
|
+
if name not in names or fn.__closure__ is None:
|
|
131
|
+
return None
|
|
132
|
+
return fn.__closure__[names.index(name)]
|
|
133
|
+
|
|
134
|
+
exec_cell = _cell_by_name(afunc, "_execute_model_async")
|
|
135
|
+
if exec_cell is None:
|
|
136
|
+
SYLogger.warning(
|
|
137
|
+
f"[DeepAgent] amodel_node 闭包未含 _execute_model_async "
|
|
138
|
+
f"(freevars={afunc.__code__.co_freevars}), skip streaming patch")
|
|
139
|
+
return
|
|
140
|
+
|
|
141
|
+
original_execute = exec_cell.cell_contents
|
|
142
|
+
# 强校验 _execute_model_async 自身的闭包含预期三个自由变量
|
|
143
|
+
_gbm_cell = _cell_by_name(original_execute, "_get_bound_model")
|
|
144
|
+
_hmo_cell = _cell_by_name(original_execute, "_handle_model_output")
|
|
145
|
+
_name_cell = _cell_by_name(original_execute, "name")
|
|
146
|
+
if _gbm_cell is None or _hmo_cell is None:
|
|
147
|
+
SYLogger.warning(
|
|
148
|
+
f"[DeepAgent] _execute_model_async 闭包结构不符 "
|
|
149
|
+
f"(freevars={getattr(original_execute, '__code__', None) and original_execute.__code__.co_freevars}), "
|
|
150
|
+
f"skip streaming patch(降级为非流式,功能正常)")
|
|
151
|
+
return
|
|
152
|
+
_get_bound_model = _gbm_cell.cell_contents
|
|
153
|
+
_handle_model_output = _hmo_cell.cell_contents
|
|
154
|
+
_name = _name_cell.cell_contents if _name_cell is not None else None
|
|
155
|
+
|
|
156
|
+
def _clamp_max_tokens_for_model(model_, messages):
|
|
157
|
+
"""在 raw_model 上执行 _clamp_max_tokens 逻辑。
|
|
158
|
+
|
|
159
|
+
由于 create_deep_agent 提取了 raw_model(绕过了 LLMWithTokenTracking 包装),
|
|
160
|
+
原本在 LLMWithTokenTracking._agenerate 中自动执行的 _clamp_max_tokens 被跳过,
|
|
161
|
+
导致 max_tokens 不随 input tokens 动态调整,当 input + max_output > context_window
|
|
162
|
+
时触发 400 错误。此函数补上这一逻辑。
|
|
163
|
+
|
|
164
|
+
注意:_get_bound_model 返回的可能是 _ChatModelBinding(RunnableBindingBase 子类),
|
|
165
|
+
需要通过 .bound 取到真正的 ChatOpenAI,否则 max_tokens 只设在 wrapper 上不生效。
|
|
166
|
+
"""
|
|
167
|
+
from sycommon.config.LLMConfig import LLMConfig
|
|
168
|
+
from sycommon.config.Config import Config
|
|
169
|
+
from sycommon.llm.token_utils import clamp_max_tokens
|
|
170
|
+
try:
|
|
171
|
+
# 解包 binding wrapper,取到真正的 ChatModel
|
|
172
|
+
raw_model = getattr(model_, 'bound', model_)
|
|
173
|
+
llm_config = Config().get_llm_config(getattr(raw_model, 'model', None))
|
|
174
|
+
if not llm_config:
|
|
175
|
+
return
|
|
176
|
+
llm_cfg = LLMConfig(**llm_config)
|
|
177
|
+
max_tokens_limit = getattr(llm_cfg, 'maxTokens', None)
|
|
178
|
+
if not max_tokens_limit:
|
|
179
|
+
return
|
|
180
|
+
max_output = getattr(raw_model, 'max_tokens', None)
|
|
181
|
+
if not max_output:
|
|
182
|
+
return
|
|
183
|
+
dynamic_max = clamp_max_tokens(
|
|
184
|
+
raw_model, messages,
|
|
185
|
+
context_window=max_tokens_limit,
|
|
186
|
+
max_output_tokens=max_output,
|
|
187
|
+
)
|
|
188
|
+
SYLogger.debug(
|
|
189
|
+
f"[StreamingPatch] clamp max_tokens: "
|
|
190
|
+
f"context={max_tokens_limit}, max_output={max_output} → {dynamic_max}")
|
|
191
|
+
except Exception as e:
|
|
192
|
+
SYLogger.warning(f"[StreamingPatch] clamp max_tokens failed: {e}")
|
|
193
|
+
|
|
194
|
+
async def _patched_execute_model_async(request):
|
|
195
|
+
"""替代 factory._execute_model_async: 用 astream + config 实现流式回调。"""
|
|
196
|
+
from langchain.agents.middleware.types import ModelResponse
|
|
197
|
+
|
|
198
|
+
model_, effective_response_format = _get_bound_model(request)
|
|
199
|
+
messages = request.messages
|
|
200
|
+
if request.system_message:
|
|
201
|
+
messages = [request.system_message, *messages]
|
|
202
|
+
|
|
203
|
+
# 动态调整 max_tokens,防止 input + max_output 超过上下文窗口
|
|
204
|
+
_clamp_max_tokens_for_model(model_, messages)
|
|
205
|
+
|
|
206
|
+
# 从 ContextVar 读取 LangGraph 注入的 config(含 StreamMessagesHandler)
|
|
207
|
+
config = var_child_runnable_config.get()
|
|
208
|
+
|
|
209
|
+
# 用 astream 替代 ainvoke, 每个 token 触发 on_llm_new_token
|
|
210
|
+
# 注意: ChatModel.astream() 产出的是 AIMessageChunk(BaseMessageChunk),
|
|
211
|
+
# 不是 ChatGenerationChunk,因此累加结果直接就是消息本身,没有 .message 属性。
|
|
212
|
+
chunks: list = []
|
|
213
|
+
async for chunk in model_.astream(messages, config=config):
|
|
214
|
+
chunks.append(chunk)
|
|
215
|
+
|
|
216
|
+
if not chunks:
|
|
217
|
+
# astream 无产出时降级到原始 ainvoke(不走流式)
|
|
218
|
+
SYLogger.warning("[StreamingPatch] astream returned empty, fallback to ainvoke")
|
|
219
|
+
output = await model_.ainvoke(messages, config=config)
|
|
220
|
+
else:
|
|
221
|
+
generation = chunks[0]
|
|
222
|
+
for c in chunks[1:]:
|
|
223
|
+
generation += c
|
|
224
|
+
# astream 累加结果可能是 AIMessageChunk(多数情况)或包裹了 .message 的
|
|
225
|
+
# ChatGenerationChunk(少数自定义模型)。两种都兼容。
|
|
226
|
+
ai_message = getattr(generation, "message", generation)
|
|
227
|
+
if isinstance(ai_message, _AIC):
|
|
228
|
+
ai_message = _AIM(
|
|
229
|
+
content=ai_message.content,
|
|
230
|
+
additional_kwargs=ai_message.additional_kwargs,
|
|
231
|
+
tool_calls=ai_message.tool_calls,
|
|
232
|
+
usage_metadata=getattr(ai_message, "usage_metadata", None),
|
|
233
|
+
response_metadata=getattr(ai_message, "response_metadata", {}),
|
|
234
|
+
id=ai_message.id,
|
|
235
|
+
)
|
|
236
|
+
output = ai_message
|
|
237
|
+
|
|
238
|
+
if _name:
|
|
239
|
+
output.name = _name
|
|
240
|
+
|
|
241
|
+
handled_output = _handle_model_output(output, effective_response_format)
|
|
242
|
+
return ModelResponse(
|
|
243
|
+
result=handled_output["messages"],
|
|
244
|
+
structured_response=handled_output.get("structured_response"),
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
# 替换闭包 cell → amodel_node 调用 patched 版本
|
|
248
|
+
exec_cell.cell_contents = _patched_execute_model_async
|
|
249
|
+
SYLogger.info(
|
|
250
|
+
f"[DeepAgent] _execute_model_async patched (astream + config) "
|
|
251
|
+
f"| langchain={_cur.get('langchain')} core={_cur.get('langchain_core')}")
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
except Exception as e:
|
|
255
|
+
SYLogger.warning(f"[DeepAgent] streaming patch failed: {e}")
|
|
59
256
|
|
|
60
257
|
|
|
61
258
|
@tool
|
|
@@ -109,6 +306,10 @@ class AgentConfig(BaseModel):
|
|
|
109
306
|
sandbox_service_name: str = "shengye-platform-sandbox"
|
|
110
307
|
sandbox_timeout: int = 300
|
|
111
308
|
skills_dir: Optional[str] = None
|
|
309
|
+
# 技能是否已同步到沙箱:True 时跳过 _sync_skills_to_sandbox 的 atree 检查,
|
|
310
|
+
# 但仍会基于 skills_dir 注入 /skills(即 SkillsMiddleware 照常挂载)。
|
|
311
|
+
# 注意:不要用「把 skills_dir 置 None」来跳过同步——那会连带关闭技能注入。
|
|
312
|
+
skills_already_synced: bool = False
|
|
112
313
|
memory_dir: Optional[str] = None
|
|
113
314
|
|
|
114
315
|
# 工具
|
|
@@ -118,7 +319,7 @@ class AgentConfig(BaseModel):
|
|
|
118
319
|
debug: bool = False
|
|
119
320
|
|
|
120
321
|
# Rubric 评分配置
|
|
121
|
-
rubric_max_iterations: int =
|
|
322
|
+
rubric_max_iterations: int = 0 # rubric 评估最大迭代次数(0 = 不启用,默认关闭)
|
|
122
323
|
|
|
123
324
|
class Config:
|
|
124
325
|
arbitrary_types_allowed = True
|
|
@@ -197,11 +398,43 @@ class DeepAgent:
|
|
|
197
398
|
input_state = {"messages": [HumanMessage(content=message)]}
|
|
198
399
|
if rubric:
|
|
199
400
|
input_state["rubric"] = rubric
|
|
401
|
+
print(f"[DeepAgent] chat() starting stream, message={repr(message[:80])}", flush=True)
|
|
200
402
|
async for chunk in self._astream_with_retry(
|
|
201
403
|
input_state,
|
|
202
404
|
max_retries=3,
|
|
203
405
|
base_delay=1.0,
|
|
204
406
|
):
|
|
407
|
+
# 🔑 详细打印 chunk 内容
|
|
408
|
+
_chunk_len = len(chunk) if isinstance(chunk, tuple) else '?'
|
|
409
|
+
if isinstance(chunk, tuple) and _chunk_len == 2:
|
|
410
|
+
# 2-tuple: either (namespace, (msg, meta)) or (msg, meta)
|
|
411
|
+
if isinstance(chunk[1], tuple) and len(chunk[1]) == 2:
|
|
412
|
+
_ns = repr(chunk[0])[:30]
|
|
413
|
+
_msg = chunk[1][0]
|
|
414
|
+
_meta = chunk[1][1]
|
|
415
|
+
else:
|
|
416
|
+
_ns = '()'
|
|
417
|
+
_msg = chunk[0]
|
|
418
|
+
_meta = chunk[1]
|
|
419
|
+
_msg_type = type(_msg).__name__
|
|
420
|
+
_content = repr(str(getattr(_msg, 'content', ''))[:80])
|
|
421
|
+
_node = _meta.get('langgraph_node', '?') if isinstance(_meta, dict) else '?'
|
|
422
|
+
_step = _meta.get('langgraph_step', '?') if isinstance(_meta, dict) else '?'
|
|
423
|
+
print(f"[DeepAgent] 2tuple: ns={_ns} msg={_msg_type} node={_node} step={_step} content={_content}", flush=True)
|
|
424
|
+
elif isinstance(chunk, tuple) and _chunk_len == 3:
|
|
425
|
+
namespace_p, _tag_p, payload_p = chunk
|
|
426
|
+
if isinstance(payload_p, tuple) and len(payload_p) == 2:
|
|
427
|
+
_msg = payload_p[0]
|
|
428
|
+
_meta = payload_p[1]
|
|
429
|
+
_msg_type = type(_msg).__name__
|
|
430
|
+
_content = repr(str(getattr(_msg, 'content', ''))[:80])
|
|
431
|
+
_node = _meta.get('langgraph_node', '?') if isinstance(_meta, dict) else '?'
|
|
432
|
+
_step = _meta.get('langgraph_step', '?') if isinstance(_meta, dict) else '?'
|
|
433
|
+
print(f"[DeepAgent] 3tuple: ns={repr(namespace_p)[:30]} msg={_msg_type} node={_node} step={_step} content={_content}", flush=True)
|
|
434
|
+
else:
|
|
435
|
+
print(f"[DeepAgent] 3tuple: payload_type={type(payload_p).__name__}", flush=True)
|
|
436
|
+
else:
|
|
437
|
+
print(f"[DeepAgent] chunk: type={type(chunk).__name__}", flush=True)
|
|
205
438
|
# 检查取消
|
|
206
439
|
if cancel_event and cancel_event.is_set():
|
|
207
440
|
event = ChatEventBuilder.cancelled("任务已取消")
|
|
@@ -212,8 +445,17 @@ class DeepAgent:
|
|
|
212
445
|
return
|
|
213
446
|
|
|
214
447
|
# 解析 chunk(subgraphs=True 格式)
|
|
448
|
+
# LangGraph v1.2+ 输出 3-tuple: (namespace, "messages", (message, metadata))
|
|
449
|
+
# 兼容旧版 2-tuple: (namespace, (message, metadata)) 或 (message, metadata)
|
|
215
450
|
namespace = ()
|
|
216
|
-
if isinstance(chunk, tuple) and len(chunk) ==
|
|
451
|
+
if isinstance(chunk, tuple) and len(chunk) == 3:
|
|
452
|
+
# 新格式: (namespace, "messages", (message, metadata))
|
|
453
|
+
namespace, _tag, payload = chunk
|
|
454
|
+
if isinstance(payload, tuple) and len(payload) == 2:
|
|
455
|
+
msg, metadata = payload
|
|
456
|
+
else:
|
|
457
|
+
continue
|
|
458
|
+
elif isinstance(chunk, tuple) and len(chunk) == 2:
|
|
217
459
|
if isinstance(chunk[1], tuple) and len(chunk[1]) == 2:
|
|
218
460
|
namespace, (msg, metadata) = chunk
|
|
219
461
|
else:
|
|
@@ -223,10 +465,29 @@ class DeepAgent:
|
|
|
223
465
|
|
|
224
466
|
stream_step += 1
|
|
225
467
|
|
|
468
|
+
# ===== 🔑 诊断日志:详细记录每个 chunk =====
|
|
469
|
+
_chunk_type = type(chunk).__name__
|
|
470
|
+
_msg_type = getattr(msg, '__class__.__name__', '?') if msg else 'None'
|
|
471
|
+
_ns = namespace if namespace else '()'
|
|
472
|
+
_node = metadata.get("langgraph_node", "?") if metadata else "?"
|
|
473
|
+
_step = metadata.get("langgraph_step", "?") if metadata else "?"
|
|
474
|
+
_content_preview = ""
|
|
475
|
+
if isinstance(msg, BaseMessage):
|
|
476
|
+
_c = msg.content or ""
|
|
477
|
+
_content_preview = repr(_c[:80]) if _c else "(empty)"
|
|
478
|
+
SYLogger.info(
|
|
479
|
+
f"[DeepAgent #{stream_step}] chunk_type={_chunk_type} msg_type={_msg_type} "
|
|
480
|
+
f"ns={_ns} node={_node} step={_step} content={_content_preview}")
|
|
481
|
+
|
|
226
482
|
# ===== 日志(仅关键节点) =====
|
|
227
483
|
if isinstance(msg, BaseMessage):
|
|
228
484
|
msg_type = msg.__class__.__name__
|
|
229
485
|
|
|
486
|
+
# 🔑 跳过 subgraphs=True 导致的重复 HumanMessage
|
|
487
|
+
# (父图和子图都会发射 HumanMessage,只处理根命名空间的)
|
|
488
|
+
if msg_type == "HumanMessage" and namespace != ():
|
|
489
|
+
continue
|
|
490
|
+
|
|
230
491
|
# 累积 token 统计(流式 chunk 中的 usage_metadata 兜底)
|
|
231
492
|
if msg_type in ("AIMessage", "AIMessageChunk"):
|
|
232
493
|
usage_meta = getattr(msg, "usage_metadata", None)
|
|
@@ -249,8 +510,17 @@ class DeepAgent:
|
|
|
249
510
|
SYLogger.debug(
|
|
250
511
|
f"[DeepAgent #{stream_step}] tool_call | {tc_l.get('name','?')} | args={args_str}")
|
|
251
512
|
elif not (msg.content or ""):
|
|
252
|
-
|
|
253
|
-
|
|
513
|
+
# 检查是否有 reasoning_content(思考模式下内容在 reasoning_content 而非 content)
|
|
514
|
+
_rc = (
|
|
515
|
+
getattr(msg, "reasoning_content", None)
|
|
516
|
+
or getattr(msg, "additional_kwargs", {}).get("reasoning_content", None)
|
|
517
|
+
)
|
|
518
|
+
if _rc:
|
|
519
|
+
SYLogger.debug(
|
|
520
|
+
f"[DeepAgent #{stream_step}] chunk | reasoning_content={repr(str(_rc)[:80])}")
|
|
521
|
+
else:
|
|
522
|
+
SYLogger.debug(
|
|
523
|
+
f"[DeepAgent #{stream_step}] chunk | (empty)")
|
|
254
524
|
elif msg_type == "AIMessage":
|
|
255
525
|
content_log = (msg.content or "")[:100]
|
|
256
526
|
tc_names = [tc.get('name', '?')
|
|
@@ -302,13 +572,45 @@ class DeepAgent:
|
|
|
302
572
|
await on_event(event)
|
|
303
573
|
yield event
|
|
304
574
|
|
|
575
|
+
print(f"[DeepAgent] post-yield: msg_type={type(msg).__name__}, is_BaseMessage={isinstance(msg, BaseMessage)}", flush=True)
|
|
576
|
+
|
|
305
577
|
if not isinstance(msg, BaseMessage):
|
|
578
|
+
print(f"[DeepAgent] SKIPPING non-BaseMessage: {type(msg).__name__}", flush=True)
|
|
306
579
|
continue
|
|
307
580
|
|
|
308
581
|
msg_type = msg.__class__.__name__
|
|
309
|
-
|
|
582
|
+
raw_content = msg.content
|
|
583
|
+
# 🔑 处理 content 为 list 的情况(多模态模型)
|
|
584
|
+
if isinstance(raw_content, list):
|
|
585
|
+
content = "".join(
|
|
586
|
+
item.get("text", "") if isinstance(item, dict) else str(item)
|
|
587
|
+
for item in raw_content
|
|
588
|
+
)
|
|
589
|
+
else:
|
|
590
|
+
content = raw_content or ""
|
|
310
591
|
|
|
311
592
|
if msg_type in ("AIMessage", "AIMessageChunk"):
|
|
593
|
+
# 🔑 提取 reasoning_content(思考/推理内容)
|
|
594
|
+
# 模型在 thinking 模式下会将推理过程放在 reasoning_content 字段,
|
|
595
|
+
# 而不是 content 字段。ChatOpenAI 不提取此字段,需要手动处理。
|
|
596
|
+
reasoning_content = (
|
|
597
|
+
getattr(msg, "reasoning_content", None)
|
|
598
|
+
or getattr(msg, "additional_kwargs", {}).get(
|
|
599
|
+
"reasoning_content", None
|
|
600
|
+
)
|
|
601
|
+
)
|
|
602
|
+
if reasoning_content:
|
|
603
|
+
ai_text_content += reasoning_content
|
|
604
|
+
event = ChatEventBuilder.ai_chunk(
|
|
605
|
+
reasoning_content,
|
|
606
|
+
id=getattr(msg, "id", None),
|
|
607
|
+
agent=DEFAULT_AGENT_NAME,
|
|
608
|
+
)
|
|
609
|
+
event.data["reasoning"] = True
|
|
610
|
+
if on_event:
|
|
611
|
+
await on_event(event)
|
|
612
|
+
yield event
|
|
613
|
+
|
|
312
614
|
# 处理 tool_call_chunks(流式分片逐步到达,args 是字符串片段)
|
|
313
615
|
tool_call_chunks = getattr(msg, "tool_call_chunks", [])
|
|
314
616
|
if tool_call_chunks:
|
|
@@ -482,6 +784,8 @@ class DeepAgent:
|
|
|
482
784
|
SYLogger.debug(
|
|
483
785
|
f"[DeepAgent] AI chunk done | {repr(ai_chunk_buffer[:100])}...")
|
|
484
786
|
|
|
787
|
+
print(f"[DeepAgent] FOR LOOP ENDED. stream_step={stream_step}, ai_text_content={repr(ai_text_content[:100])}, tool_calls={len(current_tool_calls)}", flush=True)
|
|
788
|
+
|
|
485
789
|
# 空响应检测:模型被调用但没有产出任何文本
|
|
486
790
|
if not ai_text_content and not ai_chunk_buffer:
|
|
487
791
|
SYLogger.warning(
|
|
@@ -513,12 +817,16 @@ class DeepAgent:
|
|
|
513
817
|
yield event
|
|
514
818
|
|
|
515
819
|
except asyncio.CancelledError:
|
|
820
|
+
print("[DeepAgent] chat() CancelledError!", flush=True)
|
|
516
821
|
event = ChatEventBuilder.cancelled("任务已取消")
|
|
517
822
|
if on_event:
|
|
518
823
|
await on_event(event)
|
|
519
824
|
yield event
|
|
520
825
|
raise
|
|
521
826
|
except Exception as e:
|
|
827
|
+
print(f"[DeepAgent] chat() Exception: {type(e).__name__}: {e}", flush=True)
|
|
828
|
+
import traceback
|
|
829
|
+
traceback.print_exc()
|
|
522
830
|
SYLogger.error(f"[DeepAgent] 聊天异常: {e}")
|
|
523
831
|
event = ChatEventBuilder.error(str(e))
|
|
524
832
|
if on_event:
|
|
@@ -533,7 +841,13 @@ class DeepAgent:
|
|
|
533
841
|
|
|
534
842
|
def _parse_chunk(self, chunk) -> Tuple[Optional[BaseMessage], Optional[Dict]]:
|
|
535
843
|
"""解析流式响应的 chunk"""
|
|
536
|
-
if isinstance(chunk, tuple) and len(chunk) ==
|
|
844
|
+
if isinstance(chunk, tuple) and len(chunk) == 3:
|
|
845
|
+
# LangGraph v1.2+: (namespace, "messages", (message, metadata))
|
|
846
|
+
_ns, _tag, payload = chunk
|
|
847
|
+
if isinstance(payload, tuple) and len(payload) == 2:
|
|
848
|
+
msg, metadata = payload
|
|
849
|
+
return msg, metadata
|
|
850
|
+
elif isinstance(chunk, tuple) and len(chunk) == 2:
|
|
537
851
|
if isinstance(chunk[1], tuple) and len(chunk[1]) == 2:
|
|
538
852
|
_, (msg, metadata) = chunk
|
|
539
853
|
else:
|
|
@@ -561,19 +875,27 @@ class DeepAgent:
|
|
|
561
875
|
sandbox_retries = 0
|
|
562
876
|
max_sandbox_retries = 3
|
|
563
877
|
|
|
564
|
-
|
|
878
|
+
try:
|
|
879
|
+
while True:
|
|
565
880
|
for attempt in range(max_retries):
|
|
566
881
|
try:
|
|
882
|
+
print(f"[DeepAgent] _astream_with_retry: attempt={attempt}, starting astream...", flush=True)
|
|
883
|
+
chunk_count = 0
|
|
567
884
|
async for chunk in self.agent.astream(
|
|
568
885
|
input_data,
|
|
569
886
|
config=self.config,
|
|
570
887
|
stream_mode="messages",
|
|
571
888
|
subgraphs=True
|
|
572
889
|
):
|
|
890
|
+
chunk_count += 1
|
|
891
|
+
print(f"[DeepAgent] _astream yielding chunk #{chunk_count}", flush=True)
|
|
573
892
|
yield chunk
|
|
893
|
+
print(f"[DeepAgent] _astream yield returned, consumer processed chunk #{chunk_count}", flush=True)
|
|
894
|
+
print(f"[DeepAgent] _astream_with_retry: stream ended normally, total_chunks={chunk_count}", flush=True)
|
|
574
895
|
return
|
|
575
896
|
except (APIConnectionError, APIError, APITimeoutError, ConnectionError, httpx.RemoteProtocolError) as e:
|
|
576
897
|
last_error = e
|
|
898
|
+
print(f"[DeepAgent] _astream_with_retry: API error: {type(e).__name__}: {e}", flush=True)
|
|
577
899
|
if attempt < max_retries - 1:
|
|
578
900
|
delay = base_delay * (2 ** attempt)
|
|
579
901
|
SYLogger.warning(
|
|
@@ -609,6 +931,12 @@ class DeepAgent:
|
|
|
609
931
|
raise
|
|
610
932
|
else:
|
|
611
933
|
break
|
|
934
|
+
except GeneratorExit:
|
|
935
|
+
print("[DeepAgent] _astream_with_retry: GeneratorExit! Consumer closed the generator!", flush=True)
|
|
936
|
+
raise
|
|
937
|
+
except Exception as e:
|
|
938
|
+
print(f"[DeepAgent] _astream_with_retry: Unexpected exception: {type(e).__name__}: {e}", flush=True)
|
|
939
|
+
raise
|
|
612
940
|
|
|
613
941
|
|
|
614
942
|
async def create_deep_agent(
|
|
@@ -651,6 +979,18 @@ async def create_deep_agent(
|
|
|
651
979
|
wrap_structured=False,
|
|
652
980
|
)
|
|
653
981
|
|
|
982
|
+
# 🔑 提取底层 ChatOpenAI 原始模型
|
|
983
|
+
# LLMWithTokenTracking 重写了 _agenerate(非流式路径),
|
|
984
|
+
# 导致 ainvoke 不走 astream 路径。
|
|
985
|
+
# 本文件的 _patch_agent_streaming() 会替换模型节点的 _execute_model_async,
|
|
986
|
+
# 改用 model.astream() 触发流式回调;提取 raw_model 确保 astream / bind_tools
|
|
987
|
+
# 等方法在原始 ChatOpenAI 上工作,而不是被 LLMWithTokenTracking 的包装拦截。
|
|
988
|
+
raw_model = getattr(model, 'llm', model)
|
|
989
|
+
if raw_model is not model:
|
|
990
|
+
print(f"[DeepAgent] 提取原始模型: {type(model).__name__} → {type(raw_model).__name__}", flush=True)
|
|
991
|
+
if hasattr(raw_model, 'streaming'):
|
|
992
|
+
raw_model.streaming = True
|
|
993
|
+
|
|
654
994
|
# 创建 checkpointer
|
|
655
995
|
if checkpointer is None:
|
|
656
996
|
from sycommon.database.pg_checkpoint_service import PgCheckpointService
|
|
@@ -664,13 +1004,15 @@ async def create_deep_agent(
|
|
|
664
1004
|
agent_config = {"configurable": {"thread_id": tid}}
|
|
665
1005
|
|
|
666
1006
|
# 确定沙箱路径
|
|
667
|
-
# skills_dir: 本地目录路径 →
|
|
1007
|
+
# skills_dir: 本地目录路径 → 注入沙箱 /skills(SkillsMiddleware 据此挂载)
|
|
668
1008
|
# memory_dir: 非路径字符串 → 标记启用沙箱 /memory/AGENTS.md
|
|
669
1009
|
skills_path = "/skills" if config.skills_dir else None
|
|
670
1010
|
memory_path = "/memory/AGENTS.md" if config.memory_dir else None
|
|
671
1011
|
|
|
672
1012
|
# 同步 skills 到沙箱(按目录名检查,已存在则跳过)
|
|
673
|
-
|
|
1013
|
+
# 仅在未同步过时执行 atree 检查 + 上传;skills_already_synced=True 时跳过同步,
|
|
1014
|
+
# 但 skills_path 注入不受影响,确保 SkillsMiddleware 始终能挂载。
|
|
1015
|
+
if config.skills_dir and sandbox_backend and not config.skills_already_synced:
|
|
674
1016
|
await _sync_skills_to_sandbox(config.skills_dir, sandbox_backend)
|
|
675
1017
|
|
|
676
1018
|
# 创建 agent
|
|
@@ -706,7 +1048,7 @@ async def create_deep_agent(
|
|
|
706
1048
|
))
|
|
707
1049
|
|
|
708
1050
|
agent_kwargs = {
|
|
709
|
-
"model":
|
|
1051
|
+
"model": raw_model,
|
|
710
1052
|
"tools": config.tools or [get_current_date],
|
|
711
1053
|
"backend": sandbox_backend,
|
|
712
1054
|
"checkpointer": checkpointer,
|
|
@@ -719,7 +1061,36 @@ async def create_deep_agent(
|
|
|
719
1061
|
if memory_path:
|
|
720
1062
|
agent_kwargs["memory"] = [memory_path]
|
|
721
1063
|
|
|
1064
|
+
# 🔑 RunnableCallable trace=True monkey-patch
|
|
1065
|
+
# 确保 LangGraph 的回调链传播到所有子 runnable,
|
|
1066
|
+
# 使 var_child_runnable_config ContextVar 能被正确设置。
|
|
1067
|
+
_original_rc_init = None
|
|
1068
|
+
try:
|
|
1069
|
+
from langgraph._internal._runnable import RunnableCallable
|
|
1070
|
+
|
|
1071
|
+
_original_rc_init = RunnableCallable.__init__
|
|
1072
|
+
|
|
1073
|
+
def _patched_rc_init(self_, *args, **kwargs):
|
|
1074
|
+
kwargs['trace'] = True
|
|
1075
|
+
_original_rc_init(self_, *args, **kwargs)
|
|
1076
|
+
|
|
1077
|
+
RunnableCallable.__init__ = _patched_rc_init
|
|
1078
|
+
except Exception as _patch_err:
|
|
1079
|
+
SYLogger.warning(f"[DeepAgent] RunnableCallable monkey-patch FAILED: {_patch_err}")
|
|
1080
|
+
|
|
722
1081
|
agent = _create_deep_agent(**agent_kwargs)
|
|
1082
|
+
print(f"[DeepAgent] Agent created, type={type(agent).__name__}", flush=True)
|
|
1083
|
+
|
|
1084
|
+
# 恢复原始 __init__
|
|
1085
|
+
if _original_rc_init is not None:
|
|
1086
|
+
try:
|
|
1087
|
+
RunnableCallable.__init__ = _original_rc_init
|
|
1088
|
+
except Exception:
|
|
1089
|
+
pass
|
|
1090
|
+
|
|
1091
|
+
# 🔑 Patch _execute_model_async: 将 ainvoke 替换为 astream + config
|
|
1092
|
+
# 修复 stream_mode="messages" 只返回 1 chunk 的问题
|
|
1093
|
+
_patch_agent_streaming(agent)
|
|
723
1094
|
|
|
724
1095
|
recovery_manager = SandboxRecoveryManager(sandbox_backend)
|
|
725
1096
|
|
{sycommon_python_lib-0.2.5a27 → sycommon_python_lib-0.2.5a29}/src/sycommon/agent/multi_agent_team.py
RENAMED
|
@@ -271,6 +271,24 @@ class MultiAgentTeam:
|
|
|
271
271
|
content = msg.content or ""
|
|
272
272
|
|
|
273
273
|
if msg_type in ("AIMessage", "AIMessageChunk"):
|
|
274
|
+
# 🔑 提取 reasoning_content(思考/推理内容)
|
|
275
|
+
reasoning_content = (
|
|
276
|
+
getattr(msg, "reasoning_content", None)
|
|
277
|
+
or getattr(msg, "additional_kwargs", {}).get(
|
|
278
|
+
"reasoning_content", None
|
|
279
|
+
)
|
|
280
|
+
)
|
|
281
|
+
if reasoning_content:
|
|
282
|
+
event = ChatEventBuilder.ai_chunk(
|
|
283
|
+
reasoning_content,
|
|
284
|
+
id=getattr(msg, "id", None),
|
|
285
|
+
agent=current_agent,
|
|
286
|
+
)
|
|
287
|
+
event.data["reasoning"] = True
|
|
288
|
+
if on_event:
|
|
289
|
+
await on_event(event)
|
|
290
|
+
yield event
|
|
291
|
+
|
|
274
292
|
tool_calls = getattr(msg, "tool_calls", [])
|
|
275
293
|
|
|
276
294
|
if tool_calls:
|