44from typing_extensions import override
55
66from pipelex import log
7- from pipelex .cogt .config_cogt import CogtReportConfig
87from pipelex .cogt .exceptions import ReportingManagerError
98from pipelex .cogt .inference .cost_registry import CostRegistry
109from pipelex .cogt .inference .inference_job_abstract import InferenceJobAbstract
1110from pipelex .cogt .llm .llm_job import LLMJob
1211from pipelex .cogt .llm .llm_report import LLMTokenCostReport , LLMTokensUsage
12+ from pipelex .config import ReportingConfig
1313from pipelex .pipeline .pipeline_models import SpecialPipelineId
1414from pipelex .reporting .reporting_protocol import ReportingProtocol
1515from pipelex .tools .misc .file_utils import ensure_path , get_incremental_file_path
@@ -28,9 +28,9 @@ def add_tokens_usage(self, llm_tokens_usage: LLMTokensUsage):
2828
2929
3030class ReportingManager (ReportingProtocol ):
31- def __init__ (self , report_config : CogtReportConfig ):
31+ def __init__ (self , reporting_config : ReportingConfig ):
3232 self ._usage_registries : Dict [str , UsageRegistry ] = {}
33- self ._report_config = report_config
33+ self ._reporting_config = reporting_config
3434
3535 ############################################################
3636 # Manager lifecycle
@@ -63,13 +63,13 @@ def _report_llm_job(self, llm_job: LLMJob):
6363
6464 llm_token_cost_report : Optional [LLMTokenCostReport ] = None
6565
66- if self ._report_config .is_log_costs_to_console :
66+ if self ._reporting_config .is_log_costs_to_console :
6767 llm_token_cost_report = CostRegistry .complete_cost_report (llm_tokens_usage = llm_tokens_usage )
6868
6969 pipeline_run_id = llm_job .job_metadata .pipeline_run_id
7070 self ._get_registry (pipeline_run_id ).add_tokens_usage (llm_tokens_usage )
7171
72- if self ._report_config .is_log_costs_to_console :
72+ if self ._reporting_config .is_log_costs_to_console :
7373 log .verbose (llm_token_cost_report , title = "Token Cost report" )
7474
7575 ############################################################
@@ -96,19 +96,19 @@ def report_inference_job(self, inference_job: InferenceJobAbstract):
9696 def generate_report (self , pipeline_run_id : Optional [str ] = None ):
9797 pipeline_run_id = pipeline_run_id or SpecialPipelineId .UNTITLED
9898 cost_report_file_path : Optional [str ] = None
99- if self ._report_config .is_generate_cost_report_file_enabled :
100- ensure_path (self ._report_config .cost_report_dir_path )
99+ if self ._reporting_config .is_generate_cost_report_file_enabled :
100+ ensure_path (self ._reporting_config .cost_report_dir_path )
101101 cost_report_file_path = get_incremental_file_path (
102- base_path = self ._report_config .cost_report_dir_path ,
103- base_name = self ._report_config .cost_report_base_name ,
104- extension = self ._report_config .cost_report_extension ,
102+ base_path = self ._reporting_config .cost_report_dir_path ,
103+ base_name = self ._reporting_config .cost_report_base_name ,
104+ extension = self ._reporting_config .cost_report_extension ,
105105 )
106106
107107 registry = self ._get_registry (pipeline_run_id )
108108 CostRegistry .generate_report (
109109 pipeline_run_id = pipeline_run_id ,
110110 llm_tokens_usages = registry .get_current_tokens_usage (),
111- unit_scale = self ._report_config .cost_report_unit_scale ,
111+ unit_scale = self ._reporting_config .cost_report_unit_scale ,
112112 cost_report_file_path = cost_report_file_path ,
113113 )
114114
0 commit comments