sycommon-python-lib 0.2.2a18__tar.gz → 0.2.2a19__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.2a18 → sycommon_python_lib-0.2.2a19}/PKG-INFO +1 -1
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/pyproject.toml +1 -1
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/deep_agent.py +2 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/multi_agent_team.py +3 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/summarization_utils.py +2 -2
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/struct_token.py +4 -6
- sycommon_python_lib-0.2.2a19/src/sycommon/middleware/tool_result_truncation.py +136 -0
- sycommon_python_lib-0.2.2a19/src/sycommon/notice/__init__.py +5 -0
- sycommon_python_lib-0.2.2a19/src/sycommon/notice/wecom_message.py +328 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon_python_lib.egg-info/PKG-INFO +1 -1
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon_python_lib.egg-info/SOURCES.txt +2 -0
- sycommon_python_lib-0.2.2a18/src/sycommon/tools/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/README.md +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/setup.cfg +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/cli.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/core/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/core/console.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/core/models.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/core/project.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/core/utils.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/README.md.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/agent/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/agent/main_agent.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/agent/nodes/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/agent/nodes/example_node.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/agent/states/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/agent/states/agent_state.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/api/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/api/query.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/api/sse/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/api/sse/agent.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/app.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/client/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/db/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/db/model/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/db/model/entity.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/db/service.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/model/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/model/parse.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/tools/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/agent/tools/mq.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/.env.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/.gitignore.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/Dockerfile.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/README.md.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/app.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/app.yaml.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/client/FileServiceClient.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/client/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/model/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/model/file_info.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/base/requirements.txt.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/cli/README.md.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/cli/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/cli/app.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/cli/commands/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/cli/commands/hello.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/cli/pyproject.toml.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/cli/tools/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/README.md.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/api/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/api/echo.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/api/sse/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/api/sse/echo.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/app.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/client/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/model/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/tools/__init__.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/web/tools/mq.py.tpl +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/nexus/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/__main__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/agents/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/agents/factory.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/agents/prompts.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/browser.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/capabilities/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/capabilities/console.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/capabilities/dom.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/capabilities/network.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/capabilities/page_errors.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/capabilities/performance.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/capabilities/screenshot.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/client.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/protocol.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cdp/repl.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/cli.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/commands/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/commands/cdp_cmd.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/commands/chat_cmd.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/commands/create_cmd.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/commands/evaluate_cmd.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/commands/init_cmd.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/commands/memory_cmd.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/commands/resume_cmd.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/commands/rollback_cmd.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/commands/run_cmd.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/core/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/core/backend.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/core/config.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/core/display.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/core/git_integration.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/core/llm.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/core/state.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/evaluate/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/evaluate/api_evaluator.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/memory/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/memory/compressor.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/memory/full.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/memory/hot.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/memory/manager.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/memory/warm.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/mode/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/mode/create.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/mode/optimize.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/models/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/models/config_models.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/baseline_tests.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/checkpoint.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/convergence.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/diagnosis.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/engine.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/environment.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/experience.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/harness_prompts.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/history.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/optimization_logger.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/pre_validation.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/reward.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/strategy_bandit.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/strategy_generator.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/rl/strategy_prompts.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycli/skills/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/agent_manager.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/chat_events.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/sandbox/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/sandbox/file_ops.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/sandbox/http_sandbox_backend.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/sandbox/minio_sync.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/sandbox/sandbox_pool.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/sandbox/sandbox_recovery.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/sandbox/session.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/auth/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/auth/ldap_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/auth/wecom_ldap_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/Config.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/DatabaseConfig.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/ElasticsearchConfig.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/EmbeddingConfig.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/LLMConfig.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/LangfuseConfig.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/MQConfig.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/RedisConfig.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/RerankerConfig.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/SentryConfig.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/XxlJobConfig.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/config/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/database/async_base_db_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/database/async_database_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/database/base_db_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/database/database_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/database/elasticsearch_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/database/redis_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/database/token_usage_db_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/health/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/health/health_check.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/health/metrics.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/health/ping.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/heartbeat_process/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/heartbeat_process/heartbeat_config.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/heartbeat_process/heartbeat_process_manager.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/heartbeat_process/heartbeat_process_worker.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/embedding.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/get_llm.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/llm_logger.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/llm_tokens.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/llm_with_token_tracking.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/native_with_fallback_runnable.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/output_fixing_runnable.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/sy_langfuse.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/token_usage_es_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/token_usage_mysql_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/usage_token.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/logging/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/logging/async_sql_logger.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/logging/kafka_log.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/logging/logger_levels.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/logging/logger_wrapper.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/logging/process_logger.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/logging/sql_logger.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/background_execution.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/context.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/cors.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/docs.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/exception.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/middleware.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/monitor_memory.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/mq.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/sandbox.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/timeout.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/token_tracking.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/middleware/traceid.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/base_http.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/log.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/mqlistener_config.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/mqmsg_model.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/mqsend_config.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/sandbox.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/sso_user.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/token_usage.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/token_usage_mysql.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/models/xxljob_handler_config.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/notice/uvicorn_monitor.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/rabbitmq/process_pool_consumer.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/rabbitmq/rabbitmq_client.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/rabbitmq/rabbitmq_pool.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/rabbitmq/rabbitmq_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/rabbitmq/rabbitmq_service_client_manager.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/rabbitmq/rabbitmq_service_connection_monitor.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/rabbitmq/rabbitmq_service_consumer_manager.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/rabbitmq/rabbitmq_service_core.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/rabbitmq/rabbitmq_service_producer_manager.py +0 -0
- {sycommon_python_lib-0.2.2a18/src/sycommon/notice → sycommon_python_lib-0.2.2a19/src/sycommon/sentry}/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/sentry/sy_sentry.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/services.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/sse/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/sse/event.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/sse/sse.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/example.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/example2.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/feign.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/feign_client.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/nacos_client_base.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/nacos_config_manager.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/nacos_heartbeat_manager.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/nacos_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/nacos_service_discovery.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/nacos_service_registration.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/synacos/param.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tests/deep_agent_server.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tests/test_deep_agent.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tests/test_email.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tests/test_mq.py +0 -0
- {sycommon_python_lib-0.2.2a18/src/sycommon/sentry → sycommon_python_lib-0.2.2a19/src/sycommon/tools}/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tools/async_utils.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tools/docs.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tools/env.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tools/merge_headers.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tools/snowflake.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tools/syemail.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/tools/timing.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/xxljob/__init__.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/xxljob/xxljob_service.py +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon_python_lib.egg-info/dependency_links.txt +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon_python_lib.egg-info/entry_points.txt +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon_python_lib.egg-info/requires.txt +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon_python_lib.egg-info/top_level.txt +0 -0
- {sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/tests/test_sycli.py +0 -0
{sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/deep_agent.py
RENAMED
|
@@ -51,6 +51,7 @@ from sycommon.agent.sandbox.sandbox_recovery import SandboxRecoveryManager
|
|
|
51
51
|
from sycommon.agent.chat_events import ChatEvent, ChatEventBuilder, DEFAULT_AGENT_NAME
|
|
52
52
|
from sycommon.middleware.background_execution import BackgroundExecutionMiddleware
|
|
53
53
|
from sycommon.middleware.token_tracking import TokenTrackingMiddleware
|
|
54
|
+
from sycommon.middleware.tool_result_truncation import ToolResultTruncationMiddleware
|
|
54
55
|
from deepagents.middleware.summarization import create_summarization_tool_middleware # noqa: F401 保留 re-export
|
|
55
56
|
from sycommon.agent.summarization_utils import build_summarization_middleware
|
|
56
57
|
|
|
@@ -598,6 +599,7 @@ async def create_deep_agent(
|
|
|
598
599
|
"debug": config.debug,
|
|
599
600
|
"middleware": [
|
|
600
601
|
BackgroundExecutionMiddleware(backend=sandbox_backend),
|
|
602
|
+
ToolResultTruncationMiddleware(),
|
|
601
603
|
TokenTrackingMiddleware(model_name=config.model_name, user_id=user_id),
|
|
602
604
|
summarization_mw,
|
|
603
605
|
],
|
{sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/agent/multi_agent_team.py
RENAMED
|
@@ -44,6 +44,7 @@ from sycommon.agent.sandbox.sandbox_recovery import SandboxRecoveryManager
|
|
|
44
44
|
from sycommon.agent.chat_events import ChatEvent, ChatEventBuilder, DEFAULT_AGENT_NAME
|
|
45
45
|
from sycommon.middleware.background_execution import BackgroundExecutionMiddleware
|
|
46
46
|
from sycommon.middleware.token_tracking import TokenTrackingMiddleware
|
|
47
|
+
from sycommon.middleware.tool_result_truncation import ToolResultTruncationMiddleware
|
|
47
48
|
from deepagents.middleware.summarization import create_summarization_tool_middleware # noqa: F401 保留 re-export
|
|
48
49
|
from sycommon.agent.summarization_utils import build_summarization_middleware
|
|
49
50
|
|
|
@@ -585,6 +586,7 @@ async def create_multi_agent_team(
|
|
|
585
586
|
|
|
586
587
|
middleware = [
|
|
587
588
|
BackgroundExecutionMiddleware(backend=sandbox_backend),
|
|
589
|
+
ToolResultTruncationMiddleware(),
|
|
588
590
|
TokenTrackingMiddleware(model_name=config.model_name, user_id=user_id),
|
|
589
591
|
build_summarization_middleware(model, config.model_name, sandbox_backend),
|
|
590
592
|
]
|
|
@@ -640,6 +642,7 @@ async def create_multi_agent_team(
|
|
|
640
642
|
name=coord_name,
|
|
641
643
|
middleware=[
|
|
642
644
|
BackgroundExecutionMiddleware(backend=sandbox_backend),
|
|
645
|
+
ToolResultTruncationMiddleware(),
|
|
643
646
|
TokenTrackingMiddleware(model_name=config.model_name, user_id=user_id),
|
|
644
647
|
build_summarization_middleware(model, config.model_name, sandbox_backend),
|
|
645
648
|
],
|
|
@@ -23,7 +23,7 @@ def build_summarization_middleware(
|
|
|
23
23
|
model_name: str,
|
|
24
24
|
backend: "BACKEND_TYPES",
|
|
25
25
|
*,
|
|
26
|
-
trigger_fraction: float = 0.
|
|
26
|
+
trigger_fraction: float = 0.70,
|
|
27
27
|
keep_fraction: float = 0.10,
|
|
28
28
|
default_max_tokens: int = 200000,
|
|
29
29
|
) -> SummarizationToolMiddleware:
|
|
@@ -35,7 +35,7 @@ def build_summarization_middleware(
|
|
|
35
35
|
model: LLM 实例。
|
|
36
36
|
model_name: 模型名称(用于从 nacos 读取配置)。
|
|
37
37
|
backend: 后端实例。
|
|
38
|
-
trigger_fraction: 触发压缩的上下文窗口比例,默认
|
|
38
|
+
trigger_fraction: 触发压缩的上下文窗口比例,默认 70%。
|
|
39
39
|
keep_fraction: 压缩后保留的上下文窗口比例,默认 10%。
|
|
40
40
|
default_max_tokens: 无法从配置读取时的默认上下文窗口大小。
|
|
41
41
|
|
{sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/sycommon/llm/struct_token.py
RENAMED
|
@@ -345,7 +345,6 @@ class StructuredRunnableWithToken(Runnable):
|
|
|
345
345
|
try:
|
|
346
346
|
with self.langfuse.start_as_current_observation(as_type="span", name="invoke") as span:
|
|
347
347
|
with propagate_attributes(session_id=trace_id, user_id=user_id):
|
|
348
|
-
span.update_trace(user_id=user_id, session_id=trace_id)
|
|
349
348
|
return self._execute_chain(input, config, trace_id, user_id, span)
|
|
350
349
|
except Exception as e:
|
|
351
350
|
# Langfuse 跟踪失败不应阻断业务,降级执行
|
|
@@ -366,7 +365,6 @@ class StructuredRunnableWithToken(Runnable):
|
|
|
366
365
|
try:
|
|
367
366
|
with self.langfuse.start_as_current_observation(as_type="span", name="ainvoke") as span:
|
|
368
367
|
with propagate_attributes(session_id=trace_id, user_id=user_id):
|
|
369
|
-
span.update_trace(user_id=user_id, session_id=trace_id)
|
|
370
368
|
return await self._aexecute_chain(input, config, trace_id, user_id, span)
|
|
371
369
|
except Exception as e:
|
|
372
370
|
# Langfuse 跟踪失败不应阻断业务,降级执行
|
|
@@ -405,7 +403,7 @@ class StructuredRunnableWithToken(Runnable):
|
|
|
405
403
|
input_data = {"messages": adapted_input}
|
|
406
404
|
|
|
407
405
|
if span:
|
|
408
|
-
span.
|
|
406
|
+
span.update(input=input_data)
|
|
409
407
|
|
|
410
408
|
structured_result = self.retry_chain.invoke(
|
|
411
409
|
input_data,
|
|
@@ -413,7 +411,7 @@ class StructuredRunnableWithToken(Runnable):
|
|
|
413
411
|
)
|
|
414
412
|
|
|
415
413
|
if span:
|
|
416
|
-
span.
|
|
414
|
+
span.update(output=structured_result)
|
|
417
415
|
|
|
418
416
|
token_usage = token_handler.usage_metadata
|
|
419
417
|
structured_result._token_usage_ = token_usage
|
|
@@ -465,7 +463,7 @@ class StructuredRunnableWithToken(Runnable):
|
|
|
465
463
|
input_data = {"messages": adapted_input}
|
|
466
464
|
|
|
467
465
|
if span:
|
|
468
|
-
span.
|
|
466
|
+
span.update(input=input_data)
|
|
469
467
|
|
|
470
468
|
# 3. 调用子链
|
|
471
469
|
structured_result = await self.retry_chain.ainvoke(
|
|
@@ -474,7 +472,7 @@ class StructuredRunnableWithToken(Runnable):
|
|
|
474
472
|
)
|
|
475
473
|
|
|
476
474
|
if span:
|
|
477
|
-
span.
|
|
475
|
+
span.update(output=structured_result)
|
|
478
476
|
|
|
479
477
|
token_usage = token_handler.usage_metadata
|
|
480
478
|
structured_result._token_usage_ = token_usage
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"""工具结果截断中间件
|
|
2
|
+
|
|
3
|
+
在工具执行结果返回给 LLM 之前,自动截断过长的 ToolMessage.content,
|
|
4
|
+
防止 "Prompt exceeds max length" 错误。
|
|
5
|
+
|
|
6
|
+
通过 wrap_tool_call / awrap_tool_call 钩子拦截每个工具调用结果,
|
|
7
|
+
在结果进入对话历史之前完成截断。
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from collections.abc import Awaitable, Callable
|
|
11
|
+
from typing import Any, FrozenSet
|
|
12
|
+
|
|
13
|
+
from langchain.agents.middleware.types import (
|
|
14
|
+
AgentMiddleware,
|
|
15
|
+
AgentState,
|
|
16
|
+
ContextT,
|
|
17
|
+
ResponseT,
|
|
18
|
+
)
|
|
19
|
+
from langchain_core.messages import ToolMessage
|
|
20
|
+
from langgraph.prebuilt.tool_node import ToolCallRequest
|
|
21
|
+
from langgraph.types import Command
|
|
22
|
+
|
|
23
|
+
from sycommon.logging.kafka_log import SYLogger
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# 不需要截断的工具(输出始终很短,或前端需要完整数据)
|
|
27
|
+
DEFAULT_PASSTHROUGH_TOOLS: FrozenSet[str] = frozenset({
|
|
28
|
+
"get_download_url",
|
|
29
|
+
"get_current_date",
|
|
30
|
+
"memory",
|
|
31
|
+
"skill_manager",
|
|
32
|
+
"session_search",
|
|
33
|
+
"web_search", # web_search 已在工具内部自行截断
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
# 截断提示模板
|
|
37
|
+
DEFAULT_TRUNCATION_SUFFIX = (
|
|
38
|
+
"\n\n[输出已截断至前{kept}字符,原始长度{original}字符。"
|
|
39
|
+
"如需查看完整输出,可以:\n"
|
|
40
|
+
"1. 重新执行命令并添加过滤条件(如 grep、head、tail)\n"
|
|
41
|
+
"2. 将输出重定向到文件后用 read_file 分段读取]"
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class ToolResultTruncationMiddleware(AgentMiddleware):
|
|
46
|
+
"""截断过长的工具结果,防止超出模型上下文窗口。
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
max_content_length: 工具结果内容的最大字符长度,默认 15000(约 3750 token)。
|
|
50
|
+
模型上下文 200K token,70% 触发压缩 = 140K token,给单条工具结果留 3750 token
|
|
51
|
+
约占剩余空间的 2.6%,多条工具调用并行时也不会逼近上限。
|
|
52
|
+
passthrough_tools: 不截断的工具名集合。
|
|
53
|
+
truncation_suffix: 截断提示文本,支持 {kept} 和 {original} 占位符。
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
def __init__(
|
|
57
|
+
self,
|
|
58
|
+
*,
|
|
59
|
+
max_content_length: int = 15000,
|
|
60
|
+
passthrough_tools: FrozenSet[str] | None = None,
|
|
61
|
+
truncation_suffix: str = DEFAULT_TRUNCATION_SUFFIX,
|
|
62
|
+
) -> None:
|
|
63
|
+
self._max_content_length = max_content_length
|
|
64
|
+
self._passthrough_tools = passthrough_tools or DEFAULT_PASSTHROUGH_TOOLS
|
|
65
|
+
self._truncation_suffix = truncation_suffix
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def name(self) -> str:
|
|
69
|
+
return "ToolResultTruncationMiddleware"
|
|
70
|
+
|
|
71
|
+
def _should_passthrough(self, tool_name: str) -> bool:
|
|
72
|
+
return tool_name in self._passthrough_tools
|
|
73
|
+
|
|
74
|
+
def _truncate(self, content: str, tool_name: str) -> str:
|
|
75
|
+
if self._should_passthrough(tool_name):
|
|
76
|
+
return content
|
|
77
|
+
|
|
78
|
+
original_len = len(content)
|
|
79
|
+
if original_len <= self._max_content_length:
|
|
80
|
+
return content
|
|
81
|
+
|
|
82
|
+
kept = self._max_content_length
|
|
83
|
+
suffix = self._truncation_suffix.format(kept=kept, original=original_len)
|
|
84
|
+
truncated = content[:kept] + suffix
|
|
85
|
+
|
|
86
|
+
SYLogger.info(
|
|
87
|
+
f"[ToolResultTruncation] tool='{tool_name}' truncated: "
|
|
88
|
+
f"{original_len} -> {len(truncated)} chars"
|
|
89
|
+
)
|
|
90
|
+
return truncated
|
|
91
|
+
|
|
92
|
+
def _process_result(
|
|
93
|
+
self,
|
|
94
|
+
result: Any,
|
|
95
|
+
tool_name: str,
|
|
96
|
+
) -> Any:
|
|
97
|
+
"""处理工具调用结果,截断过长的 ToolMessage.content"""
|
|
98
|
+
if isinstance(result, Command):
|
|
99
|
+
return result
|
|
100
|
+
|
|
101
|
+
if not isinstance(result, ToolMessage):
|
|
102
|
+
return result
|
|
103
|
+
|
|
104
|
+
content = result.content
|
|
105
|
+
if not isinstance(content, str):
|
|
106
|
+
return result
|
|
107
|
+
|
|
108
|
+
new_content = self._truncate(content, tool_name)
|
|
109
|
+
if new_content is content:
|
|
110
|
+
return result
|
|
111
|
+
|
|
112
|
+
return ToolMessage(
|
|
113
|
+
content=new_content,
|
|
114
|
+
tool_call_id=result.tool_call_id,
|
|
115
|
+
name=result.name,
|
|
116
|
+
status=result.status,
|
|
117
|
+
artifact=result.artifact,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
def wrap_tool_call(
|
|
121
|
+
self,
|
|
122
|
+
request: ToolCallRequest,
|
|
123
|
+
handler: Callable[[ToolCallRequest], ToolMessage | Command],
|
|
124
|
+
) -> ToolMessage | Command:
|
|
125
|
+
tool_name = request.tool_call.get("name", "")
|
|
126
|
+
result = handler(request)
|
|
127
|
+
return self._process_result(result, tool_name)
|
|
128
|
+
|
|
129
|
+
async def awrap_tool_call(
|
|
130
|
+
self,
|
|
131
|
+
request: ToolCallRequest,
|
|
132
|
+
handler: Callable[[ToolCallRequest], Awaitable[ToolMessage | Command]],
|
|
133
|
+
) -> ToolMessage | Command:
|
|
134
|
+
tool_name = request.tool_call.get("name", "")
|
|
135
|
+
result = await handler(request)
|
|
136
|
+
return self._process_result(result, tool_name)
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"""
|
|
2
|
+
企微消息发送服务
|
|
3
|
+
|
|
4
|
+
封装企业微信「应用消息 API」和「智能机器人主动消息」两种通道:
|
|
5
|
+
- 应用消息:支持文本、Markdown、图片、文件发送(需要 corpid/corpsecret/agentid)
|
|
6
|
+
- 机器人消息:支持 Markdown、模板卡片主动推送(需要注入 WSClient 实例)
|
|
7
|
+
|
|
8
|
+
使用示例::
|
|
9
|
+
|
|
10
|
+
from sycommon.notice import WeComMessageService
|
|
11
|
+
|
|
12
|
+
svc = WeComMessageService()
|
|
13
|
+
|
|
14
|
+
# 应用消息 - 发送文件
|
|
15
|
+
await svc.send_file(touser="0633", file_path="/tmp/report.xlsx")
|
|
16
|
+
|
|
17
|
+
# 应用消息 - 发送 Markdown
|
|
18
|
+
await svc.send_markdown(touser="0633", content="# 通知\\n内容")
|
|
19
|
+
|
|
20
|
+
# 机器人主动消息
|
|
21
|
+
from aibot import WSClient, WSClientOptions
|
|
22
|
+
ws = WSClient(WSClientOptions(bot_id="...", secret="..."))
|
|
23
|
+
await ws.connect()
|
|
24
|
+
svc.set_ws_client(ws)
|
|
25
|
+
await svc.send_bot_markdown(chatid="single:user123", content="**Hello**")
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
import logging
|
|
29
|
+
import time
|
|
30
|
+
from pathlib import Path
|
|
31
|
+
from typing import Any, Dict, Optional
|
|
32
|
+
|
|
33
|
+
import aiohttp
|
|
34
|
+
from pydantic import BaseModel
|
|
35
|
+
|
|
36
|
+
from sycommon.config.Config import SingletonMeta
|
|
37
|
+
from sycommon.logging.kafka_log import SYLogger
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class WeComMessageConfig(BaseModel):
|
|
41
|
+
"""企微消息服务配置"""
|
|
42
|
+
|
|
43
|
+
corpid: str
|
|
44
|
+
corpsecret: str
|
|
45
|
+
agentid: int
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_config(cls) -> "WeComMessageConfig":
|
|
49
|
+
from sycommon.config.Config import Config
|
|
50
|
+
|
|
51
|
+
wecom_config = Config().config.get("llm", {}).get("WeCom", {})
|
|
52
|
+
corpid = wecom_config.get("corpid", "")
|
|
53
|
+
corpsecret = wecom_config.get("corpsecret", "")
|
|
54
|
+
agentid = wecom_config.get("agentid")
|
|
55
|
+
|
|
56
|
+
if not corpid or not corpsecret:
|
|
57
|
+
raise ValueError(
|
|
58
|
+
"企微配置不完整,请在 llm.WeCom 下配置 corpid 和 corpsecret"
|
|
59
|
+
)
|
|
60
|
+
if agentid is None:
|
|
61
|
+
raise ValueError(
|
|
62
|
+
"企微配置不完整,请在 llm.WeCom 下配置 agentid"
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
return cls(corpid=corpid, corpsecret=corpsecret, agentid=int(agentid))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class WeComMessageService(metaclass=SingletonMeta):
|
|
69
|
+
"""企微消息发送服务
|
|
70
|
+
|
|
71
|
+
同时支持应用消息 API 和机器人主动消息。
|
|
72
|
+
应用消息需要 corpid/corpsecret/agentid 配置。
|
|
73
|
+
机器人消息需要通过 set_ws_client() 注入 WSClient 实例。
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
def __init__(self):
|
|
77
|
+
self._config: Optional[WeComMessageConfig] = None
|
|
78
|
+
self._access_token: Optional[str] = None
|
|
79
|
+
self._token_expires_at: float = 0
|
|
80
|
+
self._ws_client: Optional[Any] = None
|
|
81
|
+
|
|
82
|
+
def _ensure_config(self) -> WeComMessageConfig:
|
|
83
|
+
if self._config is None:
|
|
84
|
+
self._config = WeComMessageConfig.from_config()
|
|
85
|
+
return self._config
|
|
86
|
+
|
|
87
|
+
def set_ws_client(self, client: Any) -> None:
|
|
88
|
+
"""设置外部管理的 WSClient 实例(用于机器人主动消息)"""
|
|
89
|
+
self._ws_client = client
|
|
90
|
+
|
|
91
|
+
# ─── Token 管理 ───
|
|
92
|
+
|
|
93
|
+
async def _get_access_token(self) -> str:
|
|
94
|
+
if self._access_token and time.time() < self._token_expires_at:
|
|
95
|
+
return self._access_token
|
|
96
|
+
|
|
97
|
+
config = self._ensure_config()
|
|
98
|
+
url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken"
|
|
99
|
+
params = {
|
|
100
|
+
"corpid": config.corpid,
|
|
101
|
+
"corpsecret": config.corpsecret,
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async with aiohttp.ClientSession() as session:
|
|
105
|
+
async with session.get(url, params=params) as resp:
|
|
106
|
+
data = await resp.json()
|
|
107
|
+
|
|
108
|
+
if data.get("errcode") != 0:
|
|
109
|
+
raise RuntimeError(f"获取企微 access_token 失败: {data}")
|
|
110
|
+
|
|
111
|
+
self._access_token = data["access_token"]
|
|
112
|
+
self._token_expires_at = time.time() + data.get("expires_in", 7200) - 300
|
|
113
|
+
SYLogger.info("[WeComMsg] access_token 已刷新")
|
|
114
|
+
return self._access_token
|
|
115
|
+
|
|
116
|
+
# ─── HTTP 辅助 ───
|
|
117
|
+
|
|
118
|
+
async def _wecom_post(self, path: str, body: dict) -> dict:
|
|
119
|
+
"""发送企微 POST 请求"""
|
|
120
|
+
token = await self._get_access_token()
|
|
121
|
+
url = f"https://qyapi.weixin.qq.com{path}?access_token={token}"
|
|
122
|
+
|
|
123
|
+
async with aiohttp.ClientSession() as session:
|
|
124
|
+
async with session.post(url, json=body) as resp:
|
|
125
|
+
return await resp.json()
|
|
126
|
+
|
|
127
|
+
async def _wecom_upload(self, file_path: str, media_type: str = "file") -> dict:
|
|
128
|
+
"""上传文件到企微素材库"""
|
|
129
|
+
token = await self._get_access_token()
|
|
130
|
+
url = (
|
|
131
|
+
f"https://qyapi.weixin.qq.com/cgi-bin/media/upload"
|
|
132
|
+
f"?access_token={token}&type={media_type}"
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
path = Path(file_path)
|
|
136
|
+
if not path.exists():
|
|
137
|
+
raise FileNotFoundError(f"文件不存在: {file_path}")
|
|
138
|
+
|
|
139
|
+
data = aiohttp.FormData()
|
|
140
|
+
data.add_field("media", open(file_path, "rb"), filename=path.name)
|
|
141
|
+
|
|
142
|
+
try:
|
|
143
|
+
async with aiohttp.ClientSession() as session:
|
|
144
|
+
async with session.post(url, data=data) as resp:
|
|
145
|
+
return await resp.json()
|
|
146
|
+
finally:
|
|
147
|
+
# FormData 内的文件对象在请求结束后由 aiohttp 关闭,
|
|
148
|
+
# 但保险起见也手动确保关闭
|
|
149
|
+
pass
|
|
150
|
+
|
|
151
|
+
# ─── 应用消息 API ───
|
|
152
|
+
|
|
153
|
+
async def send_text(
|
|
154
|
+
self, touser: str, content: str, agentid: Optional[int] = None
|
|
155
|
+
) -> Optional[dict]:
|
|
156
|
+
"""发送文本应用消息"""
|
|
157
|
+
config = self._ensure_config()
|
|
158
|
+
body = {
|
|
159
|
+
"touser": touser,
|
|
160
|
+
"msgtype": "text",
|
|
161
|
+
"agentid": agentid or config.agentid,
|
|
162
|
+
"text": {"content": content},
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
try:
|
|
166
|
+
result = await self._wecom_post("/cgi-bin/message/send", body)
|
|
167
|
+
if result.get("errcode") != 0:
|
|
168
|
+
SYLogger.warning(f"[WeComMsg] 发送文本消息失败: {result}")
|
|
169
|
+
return result
|
|
170
|
+
SYLogger.info(f"[WeComMsg] 文本消息已发送给 {touser}")
|
|
171
|
+
return result
|
|
172
|
+
except Exception as e:
|
|
173
|
+
SYLogger.error(f"[WeComMsg] 发送文本消息异常: {e}")
|
|
174
|
+
return None
|
|
175
|
+
|
|
176
|
+
async def send_markdown(
|
|
177
|
+
self, touser: str, content: str, agentid: Optional[int] = None
|
|
178
|
+
) -> Optional[dict]:
|
|
179
|
+
"""发送 Markdown 应用消息"""
|
|
180
|
+
config = self._ensure_config()
|
|
181
|
+
body = {
|
|
182
|
+
"touser": touser,
|
|
183
|
+
"msgtype": "markdown",
|
|
184
|
+
"agentid": agentid or config.agentid,
|
|
185
|
+
"markdown": {"content": content},
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
try:
|
|
189
|
+
result = await self._wecom_post("/cgi-bin/message/send", body)
|
|
190
|
+
if result.get("errcode") != 0:
|
|
191
|
+
SYLogger.warning(f"[WeComMsg] 发送 Markdown 消息失败: {result}")
|
|
192
|
+
return result
|
|
193
|
+
SYLogger.info(f"[WeComMsg] Markdown 消息已发送给 {touser}")
|
|
194
|
+
return result
|
|
195
|
+
except Exception as e:
|
|
196
|
+
SYLogger.error(f"[WeComMsg] 发送 Markdown 消息异常: {e}")
|
|
197
|
+
return None
|
|
198
|
+
|
|
199
|
+
async def send_image(
|
|
200
|
+
self, touser: str, media_id: str, agentid: Optional[int] = None
|
|
201
|
+
) -> Optional[dict]:
|
|
202
|
+
"""发送图片应用消息(需先上传获取 media_id)"""
|
|
203
|
+
config = self._ensure_config()
|
|
204
|
+
body = {
|
|
205
|
+
"touser": touser,
|
|
206
|
+
"msgtype": "image",
|
|
207
|
+
"agentid": agentid or config.agentid,
|
|
208
|
+
"image": {"media_id": media_id},
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
try:
|
|
212
|
+
result = await self._wecom_post("/cgi-bin/message/send", body)
|
|
213
|
+
if result.get("errcode") != 0:
|
|
214
|
+
SYLogger.warning(f"[WeComMsg] 发送图片消息失败: {result}")
|
|
215
|
+
return result
|
|
216
|
+
SYLogger.info(f"[WeComMsg] 图片消息已发送给 {touser}")
|
|
217
|
+
return result
|
|
218
|
+
except Exception as e:
|
|
219
|
+
SYLogger.error(f"[WeComMsg] 发送图片消息异常: {e}")
|
|
220
|
+
return None
|
|
221
|
+
|
|
222
|
+
async def upload_file(self, file_path: str) -> Optional[str]:
|
|
223
|
+
"""上传文件到企微临时素材库,返回 media_id
|
|
224
|
+
|
|
225
|
+
:param file_path: 本地文件路径
|
|
226
|
+
:return: media_id,失败返回 None
|
|
227
|
+
"""
|
|
228
|
+
try:
|
|
229
|
+
result = await self._wecom_upload(file_path, media_type="file")
|
|
230
|
+
if result.get("errcode", 0) != 0:
|
|
231
|
+
SYLogger.warning(f"[WeComMsg] 文件上传失败: {result}")
|
|
232
|
+
return None
|
|
233
|
+
media_id = result["media_id"]
|
|
234
|
+
SYLogger.info(
|
|
235
|
+
f"[WeComMsg] 文件上传成功: {Path(file_path).name} -> {media_id}"
|
|
236
|
+
)
|
|
237
|
+
return media_id
|
|
238
|
+
except Exception as e:
|
|
239
|
+
SYLogger.error(f"[WeComMsg] 文件上传异常: {e}")
|
|
240
|
+
return None
|
|
241
|
+
|
|
242
|
+
async def send_file_by_media_id(
|
|
243
|
+
self, touser: str, media_id: str, agentid: Optional[int] = None
|
|
244
|
+
) -> Optional[dict]:
|
|
245
|
+
"""通过 media_id 发送文件应用消息"""
|
|
246
|
+
config = self._ensure_config()
|
|
247
|
+
body = {
|
|
248
|
+
"touser": touser,
|
|
249
|
+
"msgtype": "file",
|
|
250
|
+
"agentid": agentid or config.agentid,
|
|
251
|
+
"file": {"media_id": media_id},
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
try:
|
|
255
|
+
result = await self._wecom_post("/cgi-bin/message/send", body)
|
|
256
|
+
if result.get("errcode") != 0:
|
|
257
|
+
SYLogger.warning(f"[WeComMsg] 发送文件消息失败: {result}")
|
|
258
|
+
return result
|
|
259
|
+
SYLogger.info(f"[WeComMsg] 文件消息已发送给 {touser}")
|
|
260
|
+
return result
|
|
261
|
+
except Exception as e:
|
|
262
|
+
SYLogger.error(f"[WeComMsg] 发送文件消息异常: {e}")
|
|
263
|
+
return None
|
|
264
|
+
|
|
265
|
+
async def send_file(
|
|
266
|
+
self, touser: str, file_path: str, agentid: Optional[int] = None
|
|
267
|
+
) -> Optional[dict]:
|
|
268
|
+
"""上传文件并发送给指定用户(便捷方法)
|
|
269
|
+
|
|
270
|
+
:param touser: 接收人 userid,多人用 "|" 分隔
|
|
271
|
+
:param file_path: 本地文件路径
|
|
272
|
+
:param agentid: 应用 agentid,默认从配置读取
|
|
273
|
+
:return: API 响应,失败返回 None
|
|
274
|
+
"""
|
|
275
|
+
media_id = await self.upload_file(file_path)
|
|
276
|
+
if not media_id:
|
|
277
|
+
return None
|
|
278
|
+
return await self.send_file_by_media_id(touser, media_id, agentid)
|
|
279
|
+
|
|
280
|
+
# ─── 机器人主动消息 ───
|
|
281
|
+
|
|
282
|
+
async def send_bot_markdown(
|
|
283
|
+
self, chatid: str, content: str
|
|
284
|
+
) -> Optional[Any]:
|
|
285
|
+
"""通过机器人 WebSocket 通道发送 Markdown 消息
|
|
286
|
+
|
|
287
|
+
:param chatid: 单聊填 userid,群聊填 chatid
|
|
288
|
+
:param content: Markdown 内容
|
|
289
|
+
:return: WsFrame,失败返回 None
|
|
290
|
+
"""
|
|
291
|
+
if not self._ws_client:
|
|
292
|
+
SYLogger.error("[WeComMsg] 未设置 WSClient,请先调用 set_ws_client()")
|
|
293
|
+
return None
|
|
294
|
+
|
|
295
|
+
try:
|
|
296
|
+
result = await self._ws_client.send_message(chatid, {
|
|
297
|
+
"msgtype": "markdown",
|
|
298
|
+
"markdown": {"content": content},
|
|
299
|
+
})
|
|
300
|
+
SYLogger.info(f"[WeComMsg] 机器人 Markdown 消息已发送到 {chatid}")
|
|
301
|
+
return result
|
|
302
|
+
except Exception as e:
|
|
303
|
+
SYLogger.error(f"[WeComMsg] 机器人发送 Markdown 异常: {e}")
|
|
304
|
+
return None
|
|
305
|
+
|
|
306
|
+
async def send_bot_template_card(
|
|
307
|
+
self, chatid: str, template_card: Dict[str, Any]
|
|
308
|
+
) -> Optional[Any]:
|
|
309
|
+
"""通过机器人 WebSocket 通道发送模板卡片消息
|
|
310
|
+
|
|
311
|
+
:param chatid: 单聊填 userid,群聊填 chatid
|
|
312
|
+
:param template_card: 模板卡片内容
|
|
313
|
+
:return: WsFrame,失败返回 None
|
|
314
|
+
"""
|
|
315
|
+
if not self._ws_client:
|
|
316
|
+
SYLogger.error("[WeComMsg] 未设置 WSClient,请先调用 set_ws_client()")
|
|
317
|
+
return None
|
|
318
|
+
|
|
319
|
+
try:
|
|
320
|
+
result = await self._ws_client.send_message(chatid, {
|
|
321
|
+
"msgtype": "template_card",
|
|
322
|
+
"template_card": template_card,
|
|
323
|
+
})
|
|
324
|
+
SYLogger.info(f"[WeComMsg] 机器人模板卡片消息已发送到 {chatid}")
|
|
325
|
+
return result
|
|
326
|
+
except Exception as e:
|
|
327
|
+
SYLogger.error(f"[WeComMsg] 机器人发送模板卡片异常: {e}")
|
|
328
|
+
return None
|
|
@@ -203,6 +203,7 @@ src/sycommon/middleware/mq.py
|
|
|
203
203
|
src/sycommon/middleware/sandbox.py
|
|
204
204
|
src/sycommon/middleware/timeout.py
|
|
205
205
|
src/sycommon/middleware/token_tracking.py
|
|
206
|
+
src/sycommon/middleware/tool_result_truncation.py
|
|
206
207
|
src/sycommon/middleware/traceid.py
|
|
207
208
|
src/sycommon/models/__init__.py
|
|
208
209
|
src/sycommon/models/base_http.py
|
|
@@ -217,6 +218,7 @@ src/sycommon/models/token_usage_mysql.py
|
|
|
217
218
|
src/sycommon/models/xxljob_handler_config.py
|
|
218
219
|
src/sycommon/notice/__init__.py
|
|
219
220
|
src/sycommon/notice/uvicorn_monitor.py
|
|
221
|
+
src/sycommon/notice/wecom_message.py
|
|
220
222
|
src/sycommon/rabbitmq/process_pool_consumer.py
|
|
221
223
|
src/sycommon/rabbitmq/rabbitmq_client.py
|
|
222
224
|
src/sycommon/rabbitmq/rabbitmq_pool.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.2.2a18 → sycommon_python_lib-0.2.2a19}/src/command/templates/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|