Skip to content

Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.

fix/wrong-imports (#100)

Thomas Hebrardecc83323ce71
diff --git a/pipelex/cogt/content_generation/assignment_models.py b/pipelex/cogt/content_generation/assignment_models.py
index a02d96bb6..c69a61579 100644
--- a/pipelex/cogt/content_generation/assignment_models.py
+++ b/pipelex/cogt/content_generation/assignment_models.py
@@ -17,7 +17,7 @@ from pipelex.cogt.ocr.ocr_handle import OcrHandle
from pipelex.cogt.ocr.ocr_input import OcrInput
from pipelex.cogt.ocr.ocr_job_components import OcrJobConfig, OcrJobParams
from pipelex.pipeline.job_metadata import JobMetadata
-from pipelex.tools.templating.jinja2_environment import Jinja2TemplateCategory
+from pipelex.tools.templating.jinja2_template_category import Jinja2TemplateCategory
from pipelex.tools.templating.templating_models import PromptingStyle
diff --git a/pipelex/cogt/content_generation/content_generator.py b/pipelex/cogt/content_generation/content_generator.py
index 4e13e72a9..4c1c8a884 100644
--- a/pipelex/cogt/content_generation/content_generator.py
+++ b/pipelex/cogt/content_generation/content_generator.py
@@ -31,7 +31,7 @@ from pipelex.cogt.ocr.ocr_job_components import OcrJobConfig, OcrJobParams
from pipelex.cogt.ocr.ocr_output import OcrOutput
from pipelex.config import get_config
from pipelex.pipeline.job_metadata import JobMetadata
-from pipelex.tools.templating.jinja2_environment import Jinja2TemplateCategory
+from pipelex.tools.templating.jinja2_template_category import Jinja2TemplateCategory
from pipelex.tools.templating.templating_models import PromptingStyle
from pipelex.tools.typing.pydantic_utils import BaseModelTypeVar
diff --git a/pipelex/cogt/content_generation/content_generator_dry.py b/pipelex/cogt/content_generation/content_generator_dry.py
index 538e8b6f5..e97509026 100644
--- a/pipelex/cogt/content_generation/content_generator_dry.py
+++ b/pipelex/cogt/content_generation/content_generator_dry.py
@@ -18,7 +18,7 @@ from pipelex.cogt.ocr.ocr_job_components import OcrJobConfig, OcrJobParams
from pipelex.cogt.ocr.ocr_output import ExtractedImageFromPage, OcrOutput, Page
from pipelex.config import get_config
from pipelex.pipeline.job_metadata import JobMetadata
-from pipelex.tools.templating.jinja2_environment import Jinja2TemplateCategory
+from pipelex.tools.templating.jinja2_template_category import Jinja2TemplateCategory
from pipelex.tools.templating.templating_models import PromptingStyle
from pipelex.tools.typing.pydantic_utils import BaseModelTypeVar
diff --git a/pipelex/cogt/content_generation/content_generator_protocol.py b/pipelex/cogt/content_generation/content_generator_protocol.py
index 52ce35ec9..6945fe22e 100644
--- a/pipelex/cogt/content_generation/content_generator_protocol.py
+++ b/pipelex/cogt/content_generation/content_generator_protocol.py
@@ -13,7 +13,7 @@ from pipelex.cogt.ocr.ocr_input import OcrInput
from pipelex.cogt.ocr.ocr_job_components import OcrJobConfig, OcrJobParams
from pipelex.cogt.ocr.ocr_output import OcrOutput
from pipelex.pipeline.job_metadata import JobMetadata
-from pipelex.tools.templating.jinja2_environment import Jinja2TemplateCategory
+from pipelex.tools.templating.jinja2_template_category import Jinja2TemplateCategory
from pipelex.tools.templating.templating_models import PromptingStyle
from pipelex.tools.typing.pydantic_utils import BaseModelTypeVar
diff --git a/pipelex/core/stuff_artefact.py b/pipelex/core/stuff_artefact.py
index c457ca3a2..45b8d3b9f 100644
--- a/pipelex/core/stuff_artefact.py
+++ b/pipelex/core/stuff_artefact.py
@@ -6,8 +6,7 @@ from typing_extensions import override
from pipelex.core.stuff_content import StuffContent
from pipelex.exceptions import StuffArtefactError
-from pipelex.tools.templating.jinja2_models import Jinja2TaggableAbstract
-from pipelex.tools.templating.jinja2_rendering import Jinja2ContextKey
+from pipelex.tools.templating.jinja2_models import Jinja2ContextKey, Jinja2TaggableAbstract
from pipelex.tools.templating.templating_models import TextFormat
diff --git a/pipelex/core/stuff_factory.py b/pipelex/core/stuff_factory.py
index 64071b3a0..1ce5d6866 100644
--- a/pipelex/core/stuff_factory.py
+++ b/pipelex/core/stuff_factory.py
@@ -5,12 +5,12 @@ from kajson.class_registry import class_registry
from pydantic import BaseModel, Field
from pipelex.config import get_config
-from pipelex.core.concept import Concept, ConceptError
+from pipelex.core.concept import Concept
from pipelex.core.concept_code_factory import ConceptCodeFactory
from pipelex.core.concept_native import NativeConcept
from pipelex.core.stuff import Stuff, StuffCreationRecord
from pipelex.core.stuff_content import StuffContent, StuffContentInitableFromStr
-from pipelex.exceptions import PipelexError
+from pipelex.exceptions import ConceptError, PipelexError
from pipelex.hub import get_required_concept
diff --git a/pipelex/pipe_controllers/pipe_batch.py b/pipelex/pipe_controllers/pipe_batch.py
index 190557ccd..39f847d3b 100644
--- a/pipelex/pipe_controllers/pipe_batch.py
+++ b/pipelex/pipe_controllers/pipe_batch.py
@@ -11,8 +11,8 @@ from pipelex.core.pipe_run_params import BatchParams, PipeRunParams
from pipelex.core.stuff import Stuff
from pipelex.core.stuff_content import ListContent, StuffContent
from pipelex.core.stuff_factory import StuffFactory
-from pipelex.core.working_memory import MAIN_STUFF_NAME, WorkingMemory, WorkingMemoryStuffNotFoundError
-from pipelex.exceptions import PipeInputError, PipeInputNotFoundError
+from pipelex.core.working_memory import MAIN_STUFF_NAME, WorkingMemory
+from pipelex.exceptions import PipeInputError, PipeInputNotFoundError, WorkingMemoryStuffNotFoundError
from pipelex.hub import get_pipe_router, get_pipeline_tracker, get_required_pipe
from pipelex.pipe_controllers.pipe_controller import PipeController
from pipelex.pipeline.job_metadata import JobMetadata
diff --git a/pipelex/pipe_operators/pipe_img_gen.py b/pipelex/pipe_operators/pipe_img_gen.py
index 0c6685252..0e53ac9ff 100644
--- a/pipelex/pipe_operators/pipe_img_gen.py
+++ b/pipelex/pipe_operators/pipe_img_gen.py
@@ -9,7 +9,7 @@ from pipelex.cogt.content_generation.content_generator_protocol import ContentGe
from pipelex.cogt.imgg.imgg_handle import ImggHandle
from pipelex.cogt.imgg.imgg_job_components import AspectRatio, Background, ImggJobParams, Quality
from pipelex.cogt.imgg.imgg_prompt import ImggPrompt
-from pipelex.config import StaticValidationErrorType, StaticValidationReaction, get_config
+from pipelex.config import StaticValidationReaction, get_config
from pipelex.core.concept_native import NativeConcept
from pipelex.core.pipe_output import PipeOutput
from pipelex.core.pipe_run_params import PipeOutputMultiplicity, PipeRunParams, output_multiplicity_to_apply
@@ -21,6 +21,7 @@ from pipelex.exceptions import (
PipeInputError,
PipeRunParamsError,
StaticValidationError,
+ StaticValidationErrorType,
UnexpectedPipeDefinitionError,
WorkingMemoryStuffNotFoundError,
)
diff --git a/pipelex/pipe_operators/pipe_jinja2_factory.py b/pipelex/pipe_operators/pipe_jinja2_factory.py
index b0dff7f05..21cef0197 100644
--- a/pipelex/pipe_operators/pipe_jinja2_factory.py
+++ b/pipelex/pipe_operators/pipe_jinja2_factory.py
@@ -7,8 +7,8 @@ from pipelex.core.pipe_blueprint import PipeBlueprint, PipeSpecificFactoryProtoc
from pipelex.core.pipe_input_spec import PipeInputSpec
from pipelex.exceptions import PipeDefinitionError
from pipelex.pipe_operators.pipe_jinja2 import PipeJinja2
-from pipelex.tools.templating.jinja2_environment import Jinja2TemplateCategory
from pipelex.tools.templating.jinja2_parsing import check_jinja2_parsing
+from pipelex.tools.templating.jinja2_template_category import Jinja2TemplateCategory
from pipelex.tools.templating.template_preprocessor import preprocess_template
from pipelex.tools.templating.templating_models import PromptingStyle
diff --git a/pipelex/pipe_operators/pipe_llm.py b/pipelex/pipe_operators/pipe_llm.py
index 756562148..1fb1d74b0 100644
--- a/pipelex/pipe_operators/pipe_llm.py
+++ b/pipelex/pipe_operators/pipe_llm.py
@@ -7,9 +7,8 @@ from typing_extensions import Self, override
from pipelex import log
from pipelex.cogt.content_generation.content_generator_dry import ContentGeneratorDry
from pipelex.cogt.content_generation.content_generator_protocol import ContentGeneratorProtocol
-from pipelex.cogt.llm.llm_models.llm_deck import LLMSettingChoices
from pipelex.cogt.llm.llm_models.llm_deck_check import check_llm_setting_with_deck
-from pipelex.cogt.llm.llm_models.llm_setting import LLMSetting
+from pipelex.cogt.llm.llm_models.llm_setting import LLMSetting, LLMSettingChoices
from pipelex.cogt.llm.llm_prompt import LLMPrompt
from pipelex.cogt.llm.llm_prompt_factory_abstract import LLMPromptFactoryAbstract
from pipelex.config import StaticValidationReaction, get_config
diff --git a/pipelex/pipe_operators/pipe_llm_factory.py b/pipelex/pipe_operators/pipe_llm_factory.py
index f873ed575..e78058732 100644
--- a/pipelex/pipe_operators/pipe_llm_factory.py
+++ b/pipelex/pipe_operators/pipe_llm_factory.py
@@ -3,8 +3,7 @@ from typing import Any, Dict, List, Optional
from pydantic import model_validator
from typing_extensions import Self, override
-from pipelex.cogt.llm.llm_models.llm_deck import LLMSettingChoices
-from pipelex.cogt.llm.llm_models.llm_setting import LLMSettingOrPresetId
+from pipelex.cogt.llm.llm_models.llm_setting import LLMSettingChoices, LLMSettingOrPresetId
from pipelex.core.pipe_blueprint import PipeBlueprint, PipeSpecificFactoryProtocol
from pipelex.core.pipe_input_spec import PipeInputSpec
from pipelex.core.pipe_run_params import make_output_multiplicity
diff --git a/pipelex/pipe_operators/pipe_ocr_factory.py b/pipelex/pipe_operators/pipe_ocr_factory.py
index 19ba7a48b..fe8460d74 100644
--- a/pipelex/pipe_operators/pipe_ocr_factory.py
+++ b/pipelex/pipe_operators/pipe_ocr_factory.py
@@ -2,8 +2,9 @@ from typing import Any, Dict, Optional
from typing_extensions import override
-from pipelex.cogt.ocr.ocr_engine_factory import OcrEngineFactory, OcrPlatform
+from pipelex.cogt.ocr.ocr_engine_factory import OcrEngineFactory
from pipelex.cogt.ocr.ocr_handle import OcrHandle
+from pipelex.cogt.ocr.ocr_platform import OcrPlatform
from pipelex.config import get_config
from pipelex.core.pipe_blueprint import PipeBlueprint, PipeSpecificFactoryProtocol
from pipelex.core.pipe_input_spec import PipeInputSpec
diff --git a/pipelex/pipe_works/pipe_router.py b/pipelex/pipe_works/pipe_router.py
index 9217367f0..5961b3c9e 100644
--- a/pipelex/pipe_works/pipe_router.py
+++ b/pipelex/pipe_works/pipe_router.py
@@ -7,8 +7,9 @@ from pipelex.core.pipe_output import PipeOutputType
from pipelex.core.pipe_run_params import PipeRunParams
from pipelex.core.working_memory import WorkingMemory
from pipelex.hub import get_required_pipe
+from pipelex.pipe_works.pipe_job import PipeJob
from pipelex.pipe_works.pipe_job_factory import PipeJobFactory
-from pipelex.pipe_works.pipe_router_protocol import PipeJob, PipeRouterProtocol
+from pipelex.pipe_works.pipe_router_protocol import PipeRouterProtocol
from pipelex.pipeline.job_metadata import JobMetadata
diff --git a/pipelex/pipeline/activity/activity_handler.py b/pipelex/pipeline/activity/activity_handler.py
index 904efc6bb..e71545be0 100644
--- a/pipelex/pipeline/activity/activity_handler.py
+++ b/pipelex/pipeline/activity/activity_handler.py
@@ -3,7 +3,7 @@ from typing import Set, cast
from pipelex import log
from pipelex.config import get_config
-from pipelex.core.stuff import Stuff, StuffContent
+from pipelex.core.stuff import Stuff
from pipelex.core.stuff_content import (
HtmlContent,
ImageContent,
@@ -11,6 +11,7 @@ from pipelex.core.stuff_content import (
MermaidContent,
NumberContent,
StructuredContent,
+ StuffContent,
TextContent,
)
from pipelex.pipeline.activity.activity_models import ActivityReport
diff --git a/pipelex/tools/log/log.py b/pipelex/tools/log/log.py
index 317904b86..c3bc51ff2 100644
--- a/pipelex/tools/log/log.py
+++ b/pipelex/tools/log/log.py
@@ -1,13 +1,10 @@
import logging
from typing import Any, Dict, Optional, Union
-from pipelex.tools.log.log_config import (
- LogConfig,
- LogLevel,
-)
+from pipelex.tools.log.log_config import LogConfig
from pipelex.tools.log.log_dispatch import LogDispatch
from pipelex.tools.log.log_formatter import EmojiLogFormatter, LevelAndEmojiLogFormatter
-from pipelex.tools.log.log_levels import LOGGING_LEVEL_DEV, LOGGING_LEVEL_OFF, LOGGING_LEVEL_VERBOSE
+from pipelex.tools.log.log_levels import LOGGING_LEVEL_DEV, LOGGING_LEVEL_OFF, LOGGING_LEVEL_VERBOSE, LogLevel
class Log:
diff --git a/pipelex/tools/templating/jinja2_rendering.py b/pipelex/tools/templating/jinja2_rendering.py
index c63cf1eba..20c2355e1 100644
--- a/pipelex/tools/templating/jinja2_rendering.py
+++ b/pipelex/tools/templating/jinja2_rendering.py
@@ -8,6 +8,7 @@ from jinja2.exceptions import (
)
from pipelex import log
+from pipelex.tools.templating.jinja2_environment import make_jinja2_env_from_template_provider
from pipelex.tools.templating.jinja2_errors import (
Jinja2ContextError,
Jinja2RenderError,
@@ -15,7 +16,6 @@ from pipelex.tools.templating.jinja2_errors import (
make_jinja2_error_explanation,
)
from pipelex.tools.templating.jinja2_models import Jinja2ContextKey
-from pipelex.tools.templating.jinja2_required_variables import make_jinja2_env_from_template_provider
from pipelex.tools.templating.jinja2_template_category import Jinja2TemplateCategory
from pipelex.tools.templating.template_provider_abstract import TemplateProviderAbstract
from pipelex.tools.templating.templating_models import PromptingStyle