mirror of
https://github.com/microsoft/graphrag.git
synced 2025-06-26 23:19:58 +00:00

* Move covariate run conditional * All pipeline registration * Fix method name construction * Rename context storage -> output_storage * Rename OutputConfig as generic StorageConfig * Reuse Storage model under InputConfig * Move input storage creation out of document loading * Move document loading into workflows * Semver * Fix smoke test config for new workflows * Fix unit tests --------- Co-authored-by: Alonso Guevara <alonsog@microsoft.com>
36 lines
1.3 KiB
Python
36 lines
1.3 KiB
Python
# Copyright (c) 2024 Microsoft Corporation.
|
|
# Licensed under the MIT License
|
|
|
|
# isort: skip_file
|
|
"""A module containing the 'PipelineRunContext' models."""
|
|
|
|
from dataclasses import dataclass
|
|
|
|
from graphrag.cache.pipeline_cache import PipelineCache
|
|
from graphrag.callbacks.workflow_callbacks import WorkflowCallbacks
|
|
from graphrag.index.typing.state import PipelineState
|
|
from graphrag.index.typing.stats import PipelineRunStats
|
|
from graphrag.logger.base import ProgressLogger
|
|
from graphrag.storage.pipeline_storage import PipelineStorage
|
|
|
|
|
|
@dataclass
|
|
class PipelineRunContext:
|
|
"""Provides the context for the current pipeline run."""
|
|
|
|
stats: PipelineRunStats
|
|
input_storage: PipelineStorage
|
|
"Storage for input documents."
|
|
output_storage: PipelineStorage
|
|
"Long-term storage for pipeline verbs to use. Items written here will be written to the storage provider."
|
|
previous_storage: PipelineStorage
|
|
"Storage for previous pipeline run when running in update mode."
|
|
cache: PipelineCache
|
|
"Cache instance for reading previous LLM responses."
|
|
callbacks: WorkflowCallbacks
|
|
"Callbacks to be called during the pipeline run."
|
|
progress_logger: ProgressLogger
|
|
"Progress logger for the pipeline run."
|
|
state: PipelineState
|
|
"Arbitrary property bag for runtime state, persistent pre-computes, or experimental features."
|