Download api/core/ops/base_trace_instance.py from ZHZ1024/dify: direct link, hf CLI and curl.
- Browser
- Download file 722 Bytes
-
https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/api/core/ops/base_trace_instance.py
- Command line
-
hf download hf://spaces/ZHZ1024/dify/api/core/ops/base_trace_instance.py
-
curl -L -o base_trace_instance.py https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/api/core/ops/base_trace_instance.py
722 Bytes
| from abc import ABC, abstractmethod | |
| from core.ops.entities.config_entity import BaseTracingConfig | |
| from core.ops.entities.trace_entity import BaseTraceInfo | |
| class BaseTraceInstance(ABC): | |
| """ | |
| Base trace instance for ops trace services | |
| """ | |
| def __init__(self, trace_config: BaseTracingConfig): | |
| """ | |
| Abstract initializer for the trace instance. | |
| Distribute trace tasks by matching entities | |
| """ | |
| self.trace_config = trace_config | |
| def trace(self, trace_info: BaseTraceInfo): | |
| """ | |
| Abstract method to trace activities. | |
| Subclasses must implement specific tracing logic for activities. | |
| """ | |
| ... | |