mermaid-trace 0.6.0.post0__tar.gz → 0.6.1.post0__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.
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/PKG-INFO +4 -1
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/CHANGELOG.md +21 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/integrations/langchain.md +24 -12
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/CHANGELOG.md +21 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/UPDATE_LOG.md +13 -2
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/integrations/langchain.md +23 -11
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/09_langchain_integration.py +1 -1
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/core/config_override/dummy.mmd +3 -3
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/integrations/integration_fastapi/api_flow.mmd +1 -1
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/pyproject.toml +6 -1
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/integrations/langchain.py +152 -17
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/.github/workflows/ci.yml +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/.github/workflows/release.yml +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/.gitignore +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/LICENSE +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/README.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/README_CN.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/SECURITY.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/API.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/CONTRIBUTING.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/LICENSE +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/USER_GUIDE.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/__init__.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/cli.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/core/__init__.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/core/config.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/core/context.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/core/decorators.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/core/events.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/core/formatter.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/core/utils.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/handlers/async_handler.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/handlers/mermaid_handler.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/integrations/__init__.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/integrations/fastapi.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/en/code_comments/src/mermaid_trace/server.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/images/master_preview.png +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/API.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/CONTRIBUTING.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/LICENSE +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/UPDATE_SUMMARY.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/USER_GUIDE.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/__init__.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/cli.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/__init__.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/config.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/context.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/decorators.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/events.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/formatter.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/image/context/1769443810901.png +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/image/context/1769443817389.png +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/image/context/1769443818915.png +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/image/context/1769443830665.png +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/image/context/1769443835553.png +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/core/utils.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/handlers/async_handler.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/handlers/mermaid_handler.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/integrations/__init__.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/integrations/fastapi.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/docs/zh/code_comments/src/mermaid_trace/server.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/01_basic_usage.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/02_advanced_instrumentation.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/03_async_concurrency.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/04_error_handling.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/05_intelligent_collapsing.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/06_fastapi_integration.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/07_full_stack_app.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/08-log-rotation.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/MermaidTrace_Demo.ipynb +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/MermaidTrace_Demo_CN.ipynb +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/README.md +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/mermaid_diagrams/basic_demo.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/comparison_demo.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/08-log-rotation.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/08-log-rotation.mmd.1 +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/08-log-rotation.mmd.2 +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/08-log-rotation.mmd.3 +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/08-log-rotation.mmd.4 +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/08-log-rotation.mmd.5 +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/async_flow.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/basic_flow.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/collapsed_flow.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/error_handling.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/fastapi_trace.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/full_stack_app.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/instrumentation_demo.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/langchain_trace.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/handlers/handlers/append.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/handlers/handlers/async_flow.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/handlers/handlers/delay.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/handlers/handlers/flush_flow.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/handlers/handlers/test_flow.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/overwrite_logic/test_overwrite_default.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/overwrite_logic/test_overwrite_false.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/scenarios/basic_flow/basic_flow.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/scenarios/concurrency/concurrency.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/scenarios/concurrency/trace_ids.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/scenarios/edge_cases/edge.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/scenarios/performance/bench_False.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/scenarios/performance/bench_True.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/tests/scenarios/performance/overhead.mmd +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/__init__.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/cli.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/core/__init__.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/core/config.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/core/context.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/core/decorators.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/core/events.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/core/formatter.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/core/utils.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/handlers/async_handler.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/handlers/mermaid_handler.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/integrations/__init__.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/integrations/fastapi.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/py.typed +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/server.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/test.db +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/__init__.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/conftest.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/__init__.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_cli.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_cli_coverage.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_config_coverage.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_config_override.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_context.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_context_extra.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_decorators_coverage.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_decorators_extra.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_events.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_formatter.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_formatter_coverage.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_formatter_extra.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_utils.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_utils_coverage.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/handlers/test_async_handler_coverage.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/handlers/test_handlers.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/handlers/test_mermaid_handler_coverage.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/integrations/test_fastapi_coverage.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/integrations/test_integration_decorators.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/integrations/test_integration_fastapi.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/integrations/test_langchain.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/scenarios/test_basic_flow.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/scenarios/test_concurrency.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/scenarios/test_edge_cases.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/scenarios/test_performance.py +0 -0
- {mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mermaid-trace
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.1.post0
|
|
4
4
|
Summary: Visualize your Python code execution flow as Mermaid Sequence Diagrams.
|
|
5
5
|
Project-URL: Documentation, https://github.com/xt765/mermaid-trace#readme
|
|
6
6
|
Project-URL: Changelog, https://github.com/xt765/mermaid-trace/blob/main/docs/en/CHANGELOG.md
|
|
@@ -49,6 +49,7 @@ Requires-Dist: watchdog>=2.0.0
|
|
|
49
49
|
Provides-Extra: all
|
|
50
50
|
Requires-Dist: fastapi>=0.100.0; extra == 'all'
|
|
51
51
|
Requires-Dist: langchain-core>=0.1.0; extra == 'all'
|
|
52
|
+
Requires-Dist: uvicorn>=0.20.0; extra == 'all'
|
|
52
53
|
Provides-Extra: dev
|
|
53
54
|
Requires-Dist: fastapi>=0.100.0; extra == 'dev'
|
|
54
55
|
Requires-Dist: httpx; extra == 'dev'
|
|
@@ -58,8 +59,10 @@ Requires-Dist: pytest; extra == 'dev'
|
|
|
58
59
|
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
59
60
|
Requires-Dist: pytest-cov; extra == 'dev'
|
|
60
61
|
Requires-Dist: ruff; extra == 'dev'
|
|
62
|
+
Requires-Dist: uvicorn>=0.20.0; extra == 'dev'
|
|
61
63
|
Provides-Extra: fastapi
|
|
62
64
|
Requires-Dist: fastapi>=0.100.0; extra == 'fastapi'
|
|
65
|
+
Requires-Dist: uvicorn>=0.20.0; extra == 'fastapi'
|
|
63
66
|
Provides-Extra: langchain
|
|
64
67
|
Requires-Dist: langchain-core>=0.1.0; extra == 'langchain'
|
|
65
68
|
Description-Content-Type: text/markdown
|
|
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.6.1] - 2026-02-02
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Mypy Type Safety**: Fixed method signature for `MermaidTraceCallbackHandler.on_retriever_end` to align with `Sequence[Document]` from LangChain core, resolving Liskov Substitution Principle violations.
|
|
12
|
+
- **Example Code**: Improved type casting in the LangChain integration example for better compatibility in environments without optional dependencies.
|
|
13
|
+
|
|
14
|
+
### Improved
|
|
15
|
+
- **Documentation Sync**: Fully updated source code comments and documentation to reflect the latest API changes.
|
|
16
|
+
|
|
8
17
|
## [0.6.0] - 2026-02-02
|
|
9
18
|
|
|
10
19
|
### Added
|
|
@@ -18,6 +27,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
18
27
|
- **Layout Optimization**: Refactored CSS Flex layout to fix vertical display issues for large diagrams.
|
|
19
28
|
- **Documentation**: Synchronized Master mode documentation and code comments across English and Chinese.
|
|
20
29
|
|
|
30
|
+
## [0.5.4] - 2026-02-02
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- **LangChain Integration**: Full support for tracing LangChain applications.
|
|
34
|
+
- **Callback Handler**: Implemented `MermaidTraceCallbackHandler` to capture lifecycle events for Chains, LLMs, ChatModels, Tools, and Retrievers.
|
|
35
|
+
- **Participant Stack**: Introduced an internal participant stack to correctly track nested calls and return arrows (`-->>`) in complex RAG and Agent workflows.
|
|
36
|
+
- **Robust Integration**: Used conditional imports to ensure `langchain-core` remains an optional dependency.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
- **Empty File Issue**: Resolved a critical bug where `.mmd` files remained empty when using LangChain integration.
|
|
40
|
+
- **Protocol Alignment**: Fixed missing `flow_event` extra parameters in the callback handler to ensure correct event capturing by `MermaidFileHandler`.
|
|
41
|
+
|
|
21
42
|
## [0.5.3] - 2026-01-27
|
|
22
43
|
|
|
23
44
|
### Added
|
|
@@ -35,23 +35,32 @@ This module provides a callback handler to capture and visualize LangChain execu
|
|
|
35
35
|
|
|
36
36
|
import logging
|
|
37
37
|
import uuid
|
|
38
|
-
from typing import Any, Dict, List, Optional,
|
|
38
|
+
from typing import Any, Dict, List, Optional, Sequence, TYPE_CHECKING
|
|
39
39
|
|
|
40
|
-
from ..core.context import LogContext
|
|
41
40
|
from ..core.events import FlowEvent
|
|
41
|
+
from ..core.context import LogContext
|
|
42
|
+
from ..core.decorators import get_flow_logger
|
|
42
43
|
|
|
43
44
|
# ----------------------------------------------------------------------
|
|
44
45
|
# Conditional Imports: Support optional LangChain dependency
|
|
45
46
|
# ----------------------------------------------------------------------
|
|
46
|
-
|
|
47
|
+
if TYPE_CHECKING:
|
|
47
48
|
from langchain_core.callbacks import BaseCallbackHandler
|
|
48
49
|
from langchain_core.outputs import LLMResult
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
from langchain_core.agents import AgentAction, AgentFinish
|
|
51
|
+
from langchain_core.documents import Document
|
|
52
|
+
else:
|
|
53
|
+
try:
|
|
54
|
+
from langchain_core.callbacks import BaseCallbackHandler
|
|
55
|
+
from langchain_core.outputs import LLMResult
|
|
56
|
+
from langchain_core.agents import AgentAction, AgentFinish
|
|
57
|
+
from langchain_core.documents import Document
|
|
58
|
+
except ImportError:
|
|
59
|
+
BaseCallbackHandler = object
|
|
60
|
+
LLMResult = Any
|
|
61
|
+
AgentAction = Any
|
|
62
|
+
AgentFinish = Any
|
|
63
|
+
Document = Any
|
|
55
64
|
|
|
56
65
|
class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
57
66
|
"""
|
|
@@ -226,10 +235,13 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
226
235
|
|
|
227
236
|
def on_retriever_end(
|
|
228
237
|
self,
|
|
229
|
-
documents:
|
|
238
|
+
documents: Sequence[Document],
|
|
239
|
+
*,
|
|
240
|
+
run_id: Any = None,
|
|
241
|
+
parent_run_id: Any = None,
|
|
230
242
|
**kwargs: Any,
|
|
231
|
-
) ->
|
|
232
|
-
"""Triggered when Retriever ends"""
|
|
243
|
+
) -> Any:
|
|
244
|
+
"""Triggered when a Retriever ends"""
|
|
233
245
|
if not self._participant_stack:
|
|
234
246
|
return
|
|
235
247
|
|
|
@@ -5,6 +5,15 @@
|
|
|
5
5
|
格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/),
|
|
6
6
|
并且本项目遵守 [Semantic Versioning](https://semver.org/lang/zh-CN/)(语义化版本控制)。
|
|
7
7
|
|
|
8
|
+
## [0.6.1] - 2026-02-02
|
|
9
|
+
|
|
10
|
+
### 修复
|
|
11
|
+
- **Mypy 类型安全**: 修复了 `MermaidTraceCallbackHandler.on_retriever_end` 的方法签名,使其与 LangChain 核心库的 `Sequence[Document]` 类型对齐,消除了 Liskov 替换原则违规。
|
|
12
|
+
- **示例代码**: 优化了 LangChain 集成示例中的类型转换,确保在无可选依赖环境下的类型检查通过性。
|
|
13
|
+
|
|
14
|
+
### 改进
|
|
15
|
+
- **文档同步**: 全面同步更新了中英文代码注释文档,确保反映最新的 API 变更。
|
|
16
|
+
|
|
8
17
|
## [0.6.0] - 2026-02-02
|
|
9
18
|
|
|
10
19
|
### 新增
|
|
@@ -18,6 +27,18 @@
|
|
|
18
27
|
- **显示布局优化**: 重构了预览界面的 CSS Flex 布局,解决了大型图表在垂直方向显示不全的问题。
|
|
19
28
|
- **文档体系**: 同步更新了 Master 模式的代码注释文档(中英文)。
|
|
20
29
|
|
|
30
|
+
## [0.5.4] - 2026-02-02
|
|
31
|
+
|
|
32
|
+
### 新增
|
|
33
|
+
- **LangChain 框架集成**: 全面支持追踪 LangChain 应用。
|
|
34
|
+
- **回调处理器**: 实现了 `MermaidTraceCallbackHandler`,支持捕获 Chain、LLM、ChatModel、Tool 和 Retriever 的全生命周期事件。
|
|
35
|
+
- **参与者栈机制**: 引入内部参与者栈,确保在复杂的 RAG 和 Agent 工作流中,嵌套调用和返回箭头(`-->>`)能够精准指向发起方。
|
|
36
|
+
- **可选依赖**: 采用条件导入机制,确保 `langchain-core` 为可选依赖。
|
|
37
|
+
|
|
38
|
+
### 修复
|
|
39
|
+
- **空文件问题**: 解决了在 LangChain 集成下生成的 `.mmd` 文件内容为空的严重问题。
|
|
40
|
+
- **协议对齐**: 修复了回调处理器中缺失的 `flow_event` 参数,确保事件能被正确记录。
|
|
41
|
+
|
|
21
42
|
## [0.5.3] - 2026-01-27
|
|
22
43
|
|
|
23
44
|
### 新增
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
# 更新日志 (UPDATE_LOG)
|
|
2
2
|
|
|
3
|
-
## [2026-02-02] -
|
|
3
|
+
## [2026-02-02] - QA 强化与文档精化 (Refinement)
|
|
4
|
+
|
|
5
|
+
### 代码质量强化
|
|
6
|
+
- **Mypy 类型安全修复**:
|
|
7
|
+
- 修复了 `MermaidTraceCallbackHandler.on_retriever_end` 的方法签名,将其与 LangChain 核心库的 `Sequence[Document]` 类型对齐,解决了 Liskov 替换原则违规错误。
|
|
8
|
+
- 在 `examples/09_langchain_integration.py` 中引入 `cast(Any, ...)`,确保在无 `langchain-core` 环境下的示例代码也能通过类型检查。
|
|
9
|
+
- **自动化检查**: 再次运行全量 Ruff 格式化与 Mypy 静态分析,确保代码库 100% 符合规范。
|
|
10
|
+
- **全量测试**: 执行 122 个测试用例,全部通过,整体覆盖率稳定在 90% 以上。
|
|
4
11
|
|
|
5
|
-
###
|
|
12
|
+
### 文档同步精化
|
|
13
|
+
- **代码注释同步**: 同步更新了 `docs/zh/code_comments/` 和 `docs/en/code_comments/` 下关于 LangChain 集成的源代码注释文档,确保文档中的示例代码与最新实现(包括 `TYPE_CHECKING` 块和方法签名)完全一致。
|
|
14
|
+
- **中英文对齐**: 确保所有新增的类型定义和逻辑说明在中英文文档中保持同步。
|
|
15
|
+
|
|
16
|
+
## [2026-02-02] - 增强型 Web 预览 (Master 模式) 与 UI 优化
|
|
6
17
|
- **基于 FastAPI 的增强服务器**: 实现了 `run_server` 函数,利用 FastAPI 搭建高性能 Web 预览后端。
|
|
7
18
|
- **SSE 实时通信**: 引入 Server-Sent Events (SSE) 机制,实现 `.mmd` 文件更新时的前端零延迟自动刷新。
|
|
8
19
|
- **交互式渲染引擎**:
|
|
@@ -43,23 +43,32 @@ MermaidTrace 的 LangChain 集成模块。
|
|
|
43
43
|
|
|
44
44
|
import logging
|
|
45
45
|
import uuid
|
|
46
|
-
from typing import Any, Dict, List, Optional,
|
|
46
|
+
from typing import Any, Dict, List, Optional, Sequence, TYPE_CHECKING
|
|
47
47
|
|
|
48
|
-
from ..core.context import LogContext
|
|
49
48
|
from ..core.events import FlowEvent
|
|
49
|
+
from ..core.context import LogContext
|
|
50
|
+
from ..core.decorators import get_flow_logger
|
|
50
51
|
|
|
51
52
|
# ----------------------------------------------------------------------
|
|
52
53
|
# 条件导入:支持可选的 LangChain 依赖
|
|
53
54
|
# ----------------------------------------------------------------------
|
|
54
|
-
|
|
55
|
+
if TYPE_CHECKING:
|
|
55
56
|
from langchain_core.callbacks import BaseCallbackHandler
|
|
56
57
|
from langchain_core.outputs import LLMResult
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
from langchain_core.agents import AgentAction, AgentFinish
|
|
59
|
+
from langchain_core.documents import Document
|
|
60
|
+
else:
|
|
61
|
+
try:
|
|
62
|
+
from langchain_core.callbacks import BaseCallbackHandler
|
|
63
|
+
from langchain_core.outputs import LLMResult
|
|
64
|
+
from langchain_core.agents import AgentAction, AgentFinish
|
|
65
|
+
from langchain_core.documents import Document
|
|
66
|
+
except ImportError:
|
|
67
|
+
BaseCallbackHandler = object
|
|
68
|
+
LLMResult = Any
|
|
69
|
+
AgentAction = Any
|
|
70
|
+
AgentFinish = Any
|
|
71
|
+
Document = Any
|
|
63
72
|
|
|
64
73
|
class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
65
74
|
"""
|
|
@@ -238,9 +247,12 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
238
247
|
|
|
239
248
|
def on_retriever_end(
|
|
240
249
|
self,
|
|
241
|
-
documents:
|
|
250
|
+
documents: Sequence[Document],
|
|
251
|
+
*,
|
|
252
|
+
run_id: Any = None,
|
|
253
|
+
parent_run_id: Any = None,
|
|
242
254
|
**kwargs: Any,
|
|
243
|
-
) ->
|
|
255
|
+
) -> Any:
|
|
244
256
|
"""当 Retriever 执行结束时触发"""
|
|
245
257
|
if not self._participant_stack:
|
|
246
258
|
return
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/09_langchain_integration.py
RENAMED
|
@@ -40,7 +40,7 @@ def demo_with_mock_langchain() -> None:
|
|
|
40
40
|
serialized={"name": "VectorStoreRetriever"}, query="What is MermaidTrace?"
|
|
41
41
|
)
|
|
42
42
|
handler.on_retriever_end(
|
|
43
|
-
documents=[{"page_content": "MermaidTrace is a tool..."}] * 2
|
|
43
|
+
documents=cast(Any, [{"page_content": "MermaidTrace is a tool..."}] * 2)
|
|
44
44
|
)
|
|
45
45
|
|
|
46
46
|
# 2. Chain execution
|
|
@@ -45,7 +45,7 @@ test_integration_decorators-->>ServiceA: Return: None
|
|
|
45
45
|
Client->>AsyncSvc: Run Async(5)
|
|
46
46
|
AsyncSvc-->>Client: Return: 10
|
|
47
47
|
SyncClient->>TestAPI: GET /sync-ok
|
|
48
|
-
TestAPI-->>SyncClient: Return: 200 (2.
|
|
48
|
+
TestAPI-->>SyncClient: Return: 200 (2.0ms)
|
|
49
49
|
Client->>TestAPI: GET /async-ok
|
|
50
50
|
TestAPI-->>Client: Return: 200 (0.6ms)
|
|
51
51
|
Client->>TestAPI: GET /nested
|
|
@@ -53,6 +53,6 @@ TestAPI->>Service: DoWork
|
|
|
53
53
|
Service-->>TestAPI: Return: 'done'
|
|
54
54
|
TestAPI-->>Client: Return: 200 (0.9ms)
|
|
55
55
|
Client->>TestAPI: POST /items/42(query=q=search)
|
|
56
|
-
TestAPI-->>Client: Return: 200 (
|
|
56
|
+
TestAPI-->>Client: Return: 200 (1.0ms)
|
|
57
57
|
Client->>TestAPI: GET /async-ok
|
|
58
|
-
TestAPI-->>Client: Return: 200 (0.
|
|
58
|
+
TestAPI-->>Client: Return: 200 (0.3ms)
|
|
@@ -36,6 +36,7 @@ dependencies = [
|
|
|
36
36
|
[project.optional-dependencies]
|
|
37
37
|
fastapi = [
|
|
38
38
|
"fastapi>=0.100.0",
|
|
39
|
+
"uvicorn>=0.20.0",
|
|
39
40
|
]
|
|
40
41
|
langchain = [
|
|
41
42
|
"langchain-core>=0.1.0",
|
|
@@ -109,7 +110,11 @@ target-version = "py310"
|
|
|
109
110
|
|
|
110
111
|
[tool.mypy]
|
|
111
112
|
strict = true
|
|
112
|
-
files = ["src
|
|
113
|
+
files = ["src", "tests"]
|
|
114
|
+
|
|
115
|
+
[[tool.mypy.overrides]]
|
|
116
|
+
module = "uvicorn.*"
|
|
117
|
+
ignore_missing_imports = true
|
|
113
118
|
|
|
114
119
|
[[tool.mypy.overrides]]
|
|
115
120
|
module = "tests.*"
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/integrations/langchain.py
RENAMED
|
@@ -5,7 +5,7 @@ This module provides a LangChain Callback Handler that allows you to automatical
|
|
|
5
5
|
generate Mermaid sequence diagrams for your LangChain chains, LLM calls, and tool usage.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
from typing import Any, Dict, List, Optional, TYPE_CHECKING
|
|
8
|
+
from typing import Any, Dict, List, Optional, Sequence, TYPE_CHECKING
|
|
9
9
|
import uuid
|
|
10
10
|
|
|
11
11
|
from ..core.events import FlowEvent
|
|
@@ -15,30 +15,35 @@ from ..core.decorators import get_flow_logger
|
|
|
15
15
|
if TYPE_CHECKING:
|
|
16
16
|
from langchain_core.callbacks import BaseCallbackHandler
|
|
17
17
|
from langchain_core.outputs import LLMResult
|
|
18
|
+
from langchain_core.agents import AgentAction, AgentFinish
|
|
19
|
+
from langchain_core.documents import Document
|
|
18
20
|
else:
|
|
19
21
|
try:
|
|
20
22
|
from langchain_core.callbacks import BaseCallbackHandler
|
|
21
23
|
from langchain_core.outputs import LLMResult
|
|
24
|
+
from langchain_core.agents import AgentAction, AgentFinish
|
|
25
|
+
from langchain_core.documents import Document
|
|
22
26
|
except ImportError:
|
|
23
27
|
BaseCallbackHandler = object
|
|
24
28
|
LLMResult = Any
|
|
29
|
+
AgentAction = Any
|
|
30
|
+
AgentFinish = Any
|
|
31
|
+
Document = Any
|
|
25
32
|
|
|
26
33
|
|
|
27
34
|
class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
28
|
-
"""
|
|
29
|
-
LangChain Callback Handler that records execution flow as Mermaid sequence diagrams.
|
|
35
|
+
"""LangChain Callback Handler that records execution flow as Mermaid sequence diagrams.
|
|
30
36
|
|
|
31
|
-
This handler intercepts LangChain events (Chain, LLM, Tool) and logs them as
|
|
37
|
+
This handler intercepts LangChain events (Chain, LLM, Tool, Agent) and logs them as
|
|
32
38
|
FlowEvents, which are then processed by MermaidTrace to generate diagrams.
|
|
33
39
|
"""
|
|
34
40
|
|
|
35
41
|
def __init__(self, host_name: str = "LangChain"):
|
|
36
|
-
"""
|
|
37
|
-
Initialize the callback handler.
|
|
42
|
+
"""Initialize the callback handler.
|
|
38
43
|
|
|
39
44
|
Args:
|
|
40
|
-
host_name
|
|
41
|
-
|
|
45
|
+
host_name: The name of the host participant in the diagram.
|
|
46
|
+
Defaults to "LangChain".
|
|
42
47
|
"""
|
|
43
48
|
if BaseCallbackHandler is object:
|
|
44
49
|
raise ImportError(
|
|
@@ -50,6 +55,7 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
50
55
|
self._participant_stack: List[str] = []
|
|
51
56
|
|
|
52
57
|
def _get_current_source(self) -> str:
|
|
58
|
+
"""Get the current source participant from stack or context."""
|
|
53
59
|
if self._participant_stack:
|
|
54
60
|
return self._participant_stack[-1]
|
|
55
61
|
return str(LogContext.get("current_participant", self.host_name))
|
|
@@ -58,6 +64,11 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
58
64
|
self,
|
|
59
65
|
serialized: Optional[Dict[str, Any]],
|
|
60
66
|
inputs: Dict[str, Any],
|
|
67
|
+
*,
|
|
68
|
+
run_id: Any = None,
|
|
69
|
+
parent_run_id: Any = None,
|
|
70
|
+
tags: Optional[List[str]] = None,
|
|
71
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
61
72
|
**kwargs: Any,
|
|
62
73
|
) -> None:
|
|
63
74
|
"""Run when chain starts running."""
|
|
@@ -81,7 +92,14 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
81
92
|
)
|
|
82
93
|
self._participant_stack.append(target)
|
|
83
94
|
|
|
84
|
-
def on_chain_end(
|
|
95
|
+
def on_chain_end(
|
|
96
|
+
self,
|
|
97
|
+
outputs: Dict[str, Any],
|
|
98
|
+
*,
|
|
99
|
+
run_id: Any = None,
|
|
100
|
+
parent_run_id: Any = None,
|
|
101
|
+
**kwargs: Any,
|
|
102
|
+
) -> None:
|
|
85
103
|
"""Run when chain ends running."""
|
|
86
104
|
if not self._participant_stack:
|
|
87
105
|
return
|
|
@@ -103,7 +121,15 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
103
121
|
)
|
|
104
122
|
|
|
105
123
|
def on_llm_start(
|
|
106
|
-
self,
|
|
124
|
+
self,
|
|
125
|
+
serialized: Optional[Dict[str, Any]],
|
|
126
|
+
prompts: List[str],
|
|
127
|
+
*,
|
|
128
|
+
run_id: Any = None,
|
|
129
|
+
parent_run_id: Any = None,
|
|
130
|
+
tags: Optional[List[str]] = None,
|
|
131
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
132
|
+
**kwargs: Any,
|
|
107
133
|
) -> None:
|
|
108
134
|
"""Run when LLM starts running."""
|
|
109
135
|
target = (serialized.get("name") if serialized else None) or "LLM"
|
|
@@ -126,6 +152,11 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
126
152
|
self,
|
|
127
153
|
serialized: Optional[Dict[str, Any]],
|
|
128
154
|
messages: List[List[Any]],
|
|
155
|
+
*,
|
|
156
|
+
run_id: Any = None,
|
|
157
|
+
parent_run_id: Any = None,
|
|
158
|
+
tags: Optional[List[str]] = None,
|
|
159
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
129
160
|
**kwargs: Any,
|
|
130
161
|
) -> None:
|
|
131
162
|
"""Run when Chat Model starts running."""
|
|
@@ -145,7 +176,14 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
145
176
|
)
|
|
146
177
|
self._participant_stack.append(target)
|
|
147
178
|
|
|
148
|
-
def on_llm_end(
|
|
179
|
+
def on_llm_end(
|
|
180
|
+
self,
|
|
181
|
+
response: LLMResult,
|
|
182
|
+
*,
|
|
183
|
+
run_id: Any = None,
|
|
184
|
+
parent_run_id: Any = None,
|
|
185
|
+
**kwargs: Any,
|
|
186
|
+
) -> None:
|
|
149
187
|
"""Run when LLM ends running."""
|
|
150
188
|
if not self._participant_stack:
|
|
151
189
|
return
|
|
@@ -166,7 +204,14 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
166
204
|
f"{source} -> {target}: {event.action}", extra={"flow_event": event}
|
|
167
205
|
)
|
|
168
206
|
|
|
169
|
-
def on_llm_error(
|
|
207
|
+
def on_llm_error(
|
|
208
|
+
self,
|
|
209
|
+
error: BaseException,
|
|
210
|
+
*,
|
|
211
|
+
run_id: Any = None,
|
|
212
|
+
parent_run_id: Any = None,
|
|
213
|
+
**kwargs: Any,
|
|
214
|
+
) -> None:
|
|
170
215
|
"""Run when LLM errors."""
|
|
171
216
|
if not self._participant_stack:
|
|
172
217
|
return
|
|
@@ -190,6 +235,11 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
190
235
|
self,
|
|
191
236
|
serialized: Optional[Dict[str, Any]],
|
|
192
237
|
query: str,
|
|
238
|
+
*,
|
|
239
|
+
run_id: Any = None,
|
|
240
|
+
parent_run_id: Any = None,
|
|
241
|
+
tags: Optional[List[str]] = None,
|
|
242
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
193
243
|
**kwargs: Any,
|
|
194
244
|
) -> None:
|
|
195
245
|
"""Run when Retriever starts running."""
|
|
@@ -209,7 +259,14 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
209
259
|
)
|
|
210
260
|
self._participant_stack.append(target)
|
|
211
261
|
|
|
212
|
-
def on_retriever_end(
|
|
262
|
+
def on_retriever_end(
|
|
263
|
+
self,
|
|
264
|
+
documents: Sequence[Document],
|
|
265
|
+
*,
|
|
266
|
+
run_id: Any = None,
|
|
267
|
+
parent_run_id: Any = None,
|
|
268
|
+
**kwargs: Any,
|
|
269
|
+
) -> Any:
|
|
213
270
|
"""Run when Retriever ends running."""
|
|
214
271
|
if not self._participant_stack:
|
|
215
272
|
return
|
|
@@ -231,7 +288,15 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
231
288
|
)
|
|
232
289
|
|
|
233
290
|
def on_tool_start(
|
|
234
|
-
self,
|
|
291
|
+
self,
|
|
292
|
+
serialized: Optional[Dict[str, Any]],
|
|
293
|
+
input_str: str,
|
|
294
|
+
*,
|
|
295
|
+
run_id: Any = None,
|
|
296
|
+
parent_run_id: Any = None,
|
|
297
|
+
tags: Optional[List[str]] = None,
|
|
298
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
299
|
+
**kwargs: Any,
|
|
235
300
|
) -> None:
|
|
236
301
|
"""Run when tool starts running."""
|
|
237
302
|
target = (serialized.get("name") if serialized else None) or "Tool"
|
|
@@ -250,7 +315,14 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
250
315
|
)
|
|
251
316
|
self._participant_stack.append(target)
|
|
252
317
|
|
|
253
|
-
def on_tool_end(
|
|
318
|
+
def on_tool_end(
|
|
319
|
+
self,
|
|
320
|
+
output: Any,
|
|
321
|
+
*,
|
|
322
|
+
run_id: Any = None,
|
|
323
|
+
parent_run_id: Any = None,
|
|
324
|
+
**kwargs: Any,
|
|
325
|
+
) -> None:
|
|
254
326
|
"""Run when tool ends running."""
|
|
255
327
|
if not self._participant_stack:
|
|
256
328
|
return
|
|
@@ -271,7 +343,63 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
271
343
|
f"{target} -> {source}: {event.action}", extra={"flow_event": event}
|
|
272
344
|
)
|
|
273
345
|
|
|
274
|
-
def
|
|
346
|
+
def on_agent_action(
|
|
347
|
+
self,
|
|
348
|
+
action: AgentAction,
|
|
349
|
+
*,
|
|
350
|
+
run_id: Any = None,
|
|
351
|
+
parent_run_id: Any = None,
|
|
352
|
+
**kwargs: Any,
|
|
353
|
+
) -> Any:
|
|
354
|
+
"""Run on agent action."""
|
|
355
|
+
target = action.tool
|
|
356
|
+
source = self._get_current_source()
|
|
357
|
+
|
|
358
|
+
event = FlowEvent(
|
|
359
|
+
source=source,
|
|
360
|
+
target=target,
|
|
361
|
+
action="Agent Action",
|
|
362
|
+
message=f"Decided to use: {target}",
|
|
363
|
+
trace_id=LogContext.get("trace_id", str(uuid.uuid4())),
|
|
364
|
+
params=str(action.tool_input),
|
|
365
|
+
)
|
|
366
|
+
self.logger.info(
|
|
367
|
+
f"{source} -> {target}: {event.action}", extra={"flow_event": event}
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
def on_agent_finish(
|
|
371
|
+
self,
|
|
372
|
+
finish: AgentFinish,
|
|
373
|
+
*,
|
|
374
|
+
run_id: Any = None,
|
|
375
|
+
parent_run_id: Any = None,
|
|
376
|
+
**kwargs: Any,
|
|
377
|
+
) -> Any:
|
|
378
|
+
"""Run on agent finish."""
|
|
379
|
+
source = self._get_current_source()
|
|
380
|
+
target = "User" # Usually agents finish by returning to the user
|
|
381
|
+
|
|
382
|
+
event = FlowEvent(
|
|
383
|
+
source=source,
|
|
384
|
+
target=target,
|
|
385
|
+
action="Agent Finish",
|
|
386
|
+
message="Final Answer Ready",
|
|
387
|
+
trace_id=LogContext.get("trace_id", str(uuid.uuid4())),
|
|
388
|
+
result=str(finish.return_values),
|
|
389
|
+
is_return=True,
|
|
390
|
+
)
|
|
391
|
+
self.logger.info(
|
|
392
|
+
f"{source} -> {target}: {event.action}", extra={"flow_event": event}
|
|
393
|
+
)
|
|
394
|
+
|
|
395
|
+
def on_chain_error(
|
|
396
|
+
self,
|
|
397
|
+
error: BaseException,
|
|
398
|
+
*,
|
|
399
|
+
run_id: Any = None,
|
|
400
|
+
parent_run_id: Any = None,
|
|
401
|
+
**kwargs: Any,
|
|
402
|
+
) -> None:
|
|
275
403
|
"""Run when chain errors."""
|
|
276
404
|
if not self._participant_stack:
|
|
277
405
|
return
|
|
@@ -291,7 +419,14 @@ class MermaidTraceCallbackHandler(BaseCallbackHandler):
|
|
|
291
419
|
f"{target} -> {source}: {event.action}", extra={"flow_event": event}
|
|
292
420
|
)
|
|
293
421
|
|
|
294
|
-
def on_tool_error(
|
|
422
|
+
def on_tool_error(
|
|
423
|
+
self,
|
|
424
|
+
error: BaseException,
|
|
425
|
+
*,
|
|
426
|
+
run_id: Any = None,
|
|
427
|
+
parent_run_id: Any = None,
|
|
428
|
+
**kwargs: Any,
|
|
429
|
+
) -> None:
|
|
295
430
|
"""Run when tool errors."""
|
|
296
431
|
if not self._participant_stack:
|
|
297
432
|
return
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/02_advanced_instrumentation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/05_intelligent_collapsing.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/examples/mermaid_diagrams/basic_demo.mmd
RENAMED
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/comparison_demo.mmd
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/async_flow.mmd
RENAMED
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/basic_flow.mmd
RENAMED
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/collapsed_flow.mmd
RENAMED
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/error_handling.mmd
RENAMED
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/fastapi_trace.mmd
RENAMED
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/mermaid_diagrams/examples/full_stack_app.mmd
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/core/decorators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/handlers/async_handler.py
RENAMED
|
File without changes
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/integrations/__init__.py
RENAMED
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/src/mermaid_trace/integrations/fastapi.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_decorators_coverage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/core/test_formatter_coverage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/integrations/test_fastapi_coverage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mermaid_trace-0.6.0.post0 → mermaid_trace-0.6.1.post0}/tests/integrations/test_langchain.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|