dify/api/core/workflow/nodes/tool
GareArc d858cbdc0c
feat(telemetry): add input/output token split to enterprise OTEL traces
- Add PROMPT_TOKENS and COMPLETION_TOKENS to WorkflowNodeExecutionMetadataKey
- Store prompt/completion tokens in node execution metadata JSON (no schema change)
- Calculate workflow-level token split by summing node executions on-the-fly
- Export gen_ai.usage.input_tokens and output_tokens to enterprise telemetry
- Add semantic convention constants for token attributes
- Maintain backward compatibility (historical data shows null)

BREAKING: None
MIGRATION: None (uses JSON metadata, no schema changes)
2026-02-03 19:27:11 -08:00
..
__init__.py feat/enhance the multi-modal support (#8818) 2024-10-21 10:43:49 +08:00
entities.py minor fix: fix error messages (#23081) 2025-07-29 10:59:43 +08:00
exc.py refactor(tool-node): introduce specific exceptions for tool node errors (#10357) 2024-11-07 14:02:38 +08:00
tool_node.py feat(telemetry): add input/output token split to enterprise OTEL traces 2026-02-03 19:27:11 -08:00