From 9d9b643976f30fdf0af16b75c9b92503b076888e Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Tue, 10 Sep 2024 16:09:27 -0700 Subject: [PATCH] Removed the `__all__` declaration from the `griptape.mixins` module. (#1164) --- CHANGELOG.md | 1 + griptape/artifacts/action_artifact.py | 2 +- griptape/artifacts/base_artifact.py | 2 +- griptape/common/actions/base_action.py | 2 +- .../contents/base_message_content.py | 2 +- .../prompt_stack/messages/base_message.py | 2 +- griptape/common/prompt_stack/prompt_stack.py | 2 +- griptape/common/reference.py | 2 +- .../configs/drivers/base_drivers_config.py | 2 +- .../base_audio_transcription_driver.py | 3 ++- .../embedding/base_embedding_driver.py | 3 ++- .../base_event_listener_driver.py | 2 +- .../base_image_generation_driver.py | 3 ++- .../base_image_generation_model_driver.py | 2 +- .../image_query/base_image_query_driver.py | 3 ++- .../base_image_query_model_driver.py | 2 +- .../base_conversation_memory_driver.py | 2 +- griptape/drivers/prompt/base_prompt_driver.py | 3 ++- .../base_text_to_speech_driver.py | 3 ++- .../vector/base_vector_store_driver.py | 3 ++- .../engines/rag/modules/base_rag_module.py | 2 +- .../response/prompt_response_rag_module.py | 2 +- griptape/engines/rag/rag_context.py | 2 +- griptape/engines/rag/stages/base_rag_stage.py | 2 +- griptape/events/base_event.py | 2 +- griptape/loaders/base_loader.py | 2 +- griptape/memory/meta/base_meta_entry.py | 2 +- .../structure/base_conversation_memory.py | 2 +- griptape/memory/structure/run.py | 2 +- griptape/memory/task/task_memory.py | 2 +- griptape/mixins/__init__.py | 19 ------------------- griptape/schemas/base_schema.py | 2 +- griptape/structures/workflow.py | 2 +- griptape/tasks/actions_subtask.py | 2 +- griptape/tasks/base_audio_generation_task.py | 3 ++- griptape/tasks/base_audio_input_task.py | 2 +- griptape/tasks/base_image_generation_task.py | 3 ++- griptape/tasks/base_task.py | 2 +- griptape/tasks/prompt_task.py | 2 +- griptape/tasks/tool_task.py | 2 +- griptape/tasks/toolkit_task.py | 2 +- griptape/tools/base_image_generation_tool.py | 2 +- griptape/tools/base_tool.py | 2 +- griptape/tools/extraction/tool.py | 2 +- griptape/tools/text_to_speech/tool.py | 2 +- tests/mocks/mock_futures_executor.py | 2 +- tests/mocks/mock_serializable.py | 2 +- .../test_image_artifact_file_output_mixin.py | 2 +- tests/unit/mixins/test_rule_mixin.py | 2 +- 49 files changed, 57 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c18e59b04..cfb97f0f1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING**: `BaseConversationMemoryDriver.load` now returns `tuple[list[Run], dict]`. This represents the runs and metadata. - **BREAKING**: `BaseConversationMemoryDriver.store` now takes `runs: list[Run]` and `metadata: dict` as input. - **BREAKING**: Parameter `file_path` on `LocalConversationMemoryDriver` renamed to `persist_file` and is now type `Optional[str]`. +- **BREAKING**: Removed the `__all__` declaration from the `griptape.mixins` module. - `Defaults.drivers_config.conversation_memory_driver` now defaults to `LocalConversationMemoryDriver` instead of `None`. - `CsvRowArtifact.to_text()` now includes the header. diff --git a/griptape/artifacts/action_artifact.py b/griptape/artifacts/action_artifact.py index a10653078a..9772bbbabb 100644 --- a/griptape/artifacts/action_artifact.py +++ b/griptape/artifacts/action_artifact.py @@ -5,7 +5,7 @@ from attrs import define, field from griptape.artifacts import BaseArtifact -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.common import ToolAction diff --git a/griptape/artifacts/base_artifact.py b/griptape/artifacts/base_artifact.py index d1e0d34f4a..82a0bbd23b 100644 --- a/griptape/artifacts/base_artifact.py +++ b/griptape/artifacts/base_artifact.py @@ -7,7 +7,7 @@ from attrs import Factory, define, field -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.common import Reference diff --git a/griptape/common/actions/base_action.py b/griptape/common/actions/base_action.py index abd9abcd45..99c4432484 100644 --- a/griptape/common/actions/base_action.py +++ b/griptape/common/actions/base_action.py @@ -1,6 +1,6 @@ from abc import ABC -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin class BaseAction(SerializableMixin, ABC): ... diff --git a/griptape/common/prompt_stack/contents/base_message_content.py b/griptape/common/prompt_stack/contents/base_message_content.py index a0b10fd050..cbd16811b6 100644 --- a/griptape/common/prompt_stack/contents/base_message_content.py +++ b/griptape/common/prompt_stack/contents/base_message_content.py @@ -5,7 +5,7 @@ from attrs import define, field -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from collections.abc import Sequence diff --git a/griptape/common/prompt_stack/messages/base_message.py b/griptape/common/prompt_stack/messages/base_message.py index 15bcd9c73e..6a0d9522eb 100644 --- a/griptape/common/prompt_stack/messages/base_message.py +++ b/griptape/common/prompt_stack/messages/base_message.py @@ -5,7 +5,7 @@ from attrs import Factory, define, field -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.common import BaseDeltaMessageContent, BaseMessageContent diff --git a/griptape/common/prompt_stack/prompt_stack.py b/griptape/common/prompt_stack/prompt_stack.py index c9f71aa209..6d8dfde75f 100644 --- a/griptape/common/prompt_stack/prompt_stack.py +++ b/griptape/common/prompt_stack/prompt_stack.py @@ -22,7 +22,7 @@ Message, TextMessageContent, ) -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.tools import BaseTool diff --git a/griptape/common/reference.py b/griptape/common/reference.py index 66a62b83fb..637c683180 100644 --- a/griptape/common/reference.py +++ b/griptape/common/reference.py @@ -5,7 +5,7 @@ from attrs import Factory, define, field -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin @define(kw_only=True) diff --git a/griptape/configs/drivers/base_drivers_config.py b/griptape/configs/drivers/base_drivers_config.py index 456249634d..0d9f476ab2 100644 --- a/griptape/configs/drivers/base_drivers_config.py +++ b/griptape/configs/drivers/base_drivers_config.py @@ -5,7 +5,7 @@ from attrs import define, field -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin from griptape.utils.decorators import lazy_property if TYPE_CHECKING: diff --git a/griptape/drivers/audio_transcription/base_audio_transcription_driver.py b/griptape/drivers/audio_transcription/base_audio_transcription_driver.py index ae46c474cf..a79d390d30 100644 --- a/griptape/drivers/audio_transcription/base_audio_transcription_driver.py +++ b/griptape/drivers/audio_transcription/base_audio_transcription_driver.py @@ -6,7 +6,8 @@ from attrs import define, field from griptape.events import EventBus, FinishAudioTranscriptionEvent, StartAudioTranscriptionEvent -from griptape.mixins import ExponentialBackoffMixin, SerializableMixin +from griptape.mixins.exponential_backoff_mixin import ExponentialBackoffMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.artifacts import AudioArtifact, TextArtifact diff --git a/griptape/drivers/embedding/base_embedding_driver.py b/griptape/drivers/embedding/base_embedding_driver.py index 8998f00e51..2a35337281 100644 --- a/griptape/drivers/embedding/base_embedding_driver.py +++ b/griptape/drivers/embedding/base_embedding_driver.py @@ -7,7 +7,8 @@ from attrs import define, field from griptape.chunkers import BaseChunker, TextChunker -from griptape.mixins import ExponentialBackoffMixin, SerializableMixin +from griptape.mixins.exponential_backoff_mixin import ExponentialBackoffMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.artifacts import TextArtifact diff --git a/griptape/drivers/event_listener/base_event_listener_driver.py b/griptape/drivers/event_listener/base_event_listener_driver.py index 75bdc9f75d..f9cb55dc93 100644 --- a/griptape/drivers/event_listener/base_event_listener_driver.py +++ b/griptape/drivers/event_listener/base_event_listener_driver.py @@ -7,7 +7,7 @@ from attrs import Factory, define, field -from griptape.mixins import FuturesExecutorMixin +from griptape.mixins.futures_executor_mixin import FuturesExecutorMixin if TYPE_CHECKING: from griptape.events import BaseEvent diff --git a/griptape/drivers/image_generation/base_image_generation_driver.py b/griptape/drivers/image_generation/base_image_generation_driver.py index 8dfca5945e..8c10ce12d5 100644 --- a/griptape/drivers/image_generation/base_image_generation_driver.py +++ b/griptape/drivers/image_generation/base_image_generation_driver.py @@ -6,7 +6,8 @@ from attrs import define, field from griptape.events import EventBus, FinishImageGenerationEvent, StartImageGenerationEvent -from griptape.mixins import ExponentialBackoffMixin, SerializableMixin +from griptape.mixins.exponential_backoff_mixin import ExponentialBackoffMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.artifacts import ImageArtifact diff --git a/griptape/drivers/image_generation_model/base_image_generation_model_driver.py b/griptape/drivers/image_generation_model/base_image_generation_model_driver.py index 9acc62890c..9dc5a9b6b4 100644 --- a/griptape/drivers/image_generation_model/base_image_generation_model_driver.py +++ b/griptape/drivers/image_generation_model/base_image_generation_model_driver.py @@ -5,7 +5,7 @@ from attrs import define -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.artifacts import ImageArtifact diff --git a/griptape/drivers/image_query/base_image_query_driver.py b/griptape/drivers/image_query/base_image_query_driver.py index 28c5713286..ecfe0ca6e5 100644 --- a/griptape/drivers/image_query/base_image_query_driver.py +++ b/griptape/drivers/image_query/base_image_query_driver.py @@ -6,7 +6,8 @@ from attrs import define, field from griptape.events import EventBus, FinishImageQueryEvent, StartImageQueryEvent -from griptape.mixins import ExponentialBackoffMixin, SerializableMixin +from griptape.mixins.exponential_backoff_mixin import ExponentialBackoffMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.artifacts import ImageArtifact, TextArtifact diff --git a/griptape/drivers/image_query_model/base_image_query_model_driver.py b/griptape/drivers/image_query_model/base_image_query_model_driver.py index 5f60367d59..ac97ee3c1a 100644 --- a/griptape/drivers/image_query_model/base_image_query_model_driver.py +++ b/griptape/drivers/image_query_model/base_image_query_model_driver.py @@ -5,7 +5,7 @@ from attrs import define -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.artifacts import ImageArtifact, TextArtifact diff --git a/griptape/drivers/memory/conversation/base_conversation_memory_driver.py b/griptape/drivers/memory/conversation/base_conversation_memory_driver.py index ea0a171f26..c9963b1eb3 100644 --- a/griptape/drivers/memory/conversation/base_conversation_memory_driver.py +++ b/griptape/drivers/memory/conversation/base_conversation_memory_driver.py @@ -3,7 +3,7 @@ from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.memory.structure import Run diff --git a/griptape/drivers/prompt/base_prompt_driver.py b/griptape/drivers/prompt/base_prompt_driver.py index c07980c9ec..778b6f474e 100644 --- a/griptape/drivers/prompt/base_prompt_driver.py +++ b/griptape/drivers/prompt/base_prompt_driver.py @@ -17,7 +17,8 @@ observable, ) from griptape.events import CompletionChunkEvent, EventBus, FinishPromptEvent, StartPromptEvent -from griptape.mixins import ExponentialBackoffMixin, SerializableMixin +from griptape.mixins.exponential_backoff_mixin import ExponentialBackoffMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from collections.abc import Iterator diff --git a/griptape/drivers/text_to_speech/base_text_to_speech_driver.py b/griptape/drivers/text_to_speech/base_text_to_speech_driver.py index cb11cc4983..b2ad8bc3e9 100644 --- a/griptape/drivers/text_to_speech/base_text_to_speech_driver.py +++ b/griptape/drivers/text_to_speech/base_text_to_speech_driver.py @@ -8,7 +8,8 @@ from griptape.events import EventBus from griptape.events.finish_text_to_speech_event import FinishTextToSpeechEvent from griptape.events.start_text_to_speech_event import StartTextToSpeechEvent -from griptape.mixins import ExponentialBackoffMixin, SerializableMixin +from griptape.mixins.exponential_backoff_mixin import ExponentialBackoffMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.artifacts.audio_artifact import AudioArtifact diff --git a/griptape/drivers/vector/base_vector_store_driver.py b/griptape/drivers/vector/base_vector_store_driver.py index 2abb29c3fb..50810752ef 100644 --- a/griptape/drivers/vector/base_vector_store_driver.py +++ b/griptape/drivers/vector/base_vector_store_driver.py @@ -9,7 +9,8 @@ from griptape import utils from griptape.artifacts import BaseArtifact, ListArtifact, TextArtifact -from griptape.mixins import FuturesExecutorMixin, SerializableMixin +from griptape.mixins.futures_executor_mixin import FuturesExecutorMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.drivers import BaseEmbeddingDriver diff --git a/griptape/engines/rag/modules/base_rag_module.py b/griptape/engines/rag/modules/base_rag_module.py index 668b3aced7..30c66f27cd 100644 --- a/griptape/engines/rag/modules/base_rag_module.py +++ b/griptape/engines/rag/modules/base_rag_module.py @@ -7,7 +7,7 @@ from attrs import Factory, define, field from griptape.common import Message, PromptStack -from griptape.mixins import FuturesExecutorMixin +from griptape.mixins.futures_executor_mixin import FuturesExecutorMixin if TYPE_CHECKING: from griptape.engines.rag import RagContext diff --git a/griptape/engines/rag/modules/response/prompt_response_rag_module.py b/griptape/engines/rag/modules/response/prompt_response_rag_module.py index 78dfba8f44..fbb8ed7e60 100644 --- a/griptape/engines/rag/modules/response/prompt_response_rag_module.py +++ b/griptape/engines/rag/modules/response/prompt_response_rag_module.py @@ -7,7 +7,7 @@ from griptape.artifacts.text_artifact import TextArtifact from griptape.configs import Defaults from griptape.engines.rag.modules import BaseResponseRagModule -from griptape.mixins import RuleMixin +from griptape.mixins.rule_mixin import RuleMixin from griptape.utils import J2 if TYPE_CHECKING: diff --git a/griptape/engines/rag/rag_context.py b/griptape/engines/rag/rag_context.py index 3dbfc6834c..b48fb3acbc 100644 --- a/griptape/engines/rag/rag_context.py +++ b/griptape/engines/rag/rag_context.py @@ -5,7 +5,7 @@ from attrs import define, field from griptape import utils -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.artifacts import BaseArtifact, TextArtifact diff --git a/griptape/engines/rag/stages/base_rag_stage.py b/griptape/engines/rag/stages/base_rag_stage.py index 6a28551b40..dfa2e6002d 100644 --- a/griptape/engines/rag/stages/base_rag_stage.py +++ b/griptape/engines/rag/stages/base_rag_stage.py @@ -5,7 +5,7 @@ from griptape.engines.rag import RagContext from griptape.engines.rag.modules import BaseRagModule -from griptape.mixins import FuturesExecutorMixin +from griptape.mixins.futures_executor_mixin import FuturesExecutorMixin @define(kw_only=True) diff --git a/griptape/events/base_event.py b/griptape/events/base_event.py index 61443107e7..f008c9cd8a 100644 --- a/griptape/events/base_event.py +++ b/griptape/events/base_event.py @@ -7,7 +7,7 @@ from attrs import Factory, define, field -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin @define diff --git a/griptape/loaders/base_loader.py b/griptape/loaders/base_loader.py index 525b4df0ad..14f9aa10f8 100644 --- a/griptape/loaders/base_loader.py +++ b/griptape/loaders/base_loader.py @@ -5,7 +5,7 @@ from attrs import define, field -from griptape.mixins import FuturesExecutorMixin +from griptape.mixins.futures_executor_mixin import FuturesExecutorMixin from griptape.utils.futures import execute_futures_dict from griptape.utils.hash import bytes_to_hash, str_to_hash diff --git a/griptape/memory/meta/base_meta_entry.py b/griptape/memory/meta/base_meta_entry.py index c1b253317f..d27e79d35a 100644 --- a/griptape/memory/meta/base_meta_entry.py +++ b/griptape/memory/meta/base_meta_entry.py @@ -4,7 +4,7 @@ from attrs import define -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin @define diff --git a/griptape/memory/structure/base_conversation_memory.py b/griptape/memory/structure/base_conversation_memory.py index 92f5bd9421..e2095b4601 100644 --- a/griptape/memory/structure/base_conversation_memory.py +++ b/griptape/memory/structure/base_conversation_memory.py @@ -7,7 +7,7 @@ from griptape.common import PromptStack from griptape.configs import Defaults -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin from griptape.utils import dict_merge if TYPE_CHECKING: diff --git a/griptape/memory/structure/run.py b/griptape/memory/structure/run.py index 5d2a182ad6..4be0b587ce 100644 --- a/griptape/memory/structure/run.py +++ b/griptape/memory/structure/run.py @@ -5,7 +5,7 @@ from attrs import Factory, define, field -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin if TYPE_CHECKING: from griptape.artifacts import BaseArtifact diff --git a/griptape/memory/task/task_memory.py b/griptape/memory/task/task_memory.py index c7f12b233b..1aa60dba3a 100644 --- a/griptape/memory/task/task_memory.py +++ b/griptape/memory/task/task_memory.py @@ -7,7 +7,7 @@ from griptape.artifacts import BaseArtifact, BlobArtifact, ErrorArtifact, InfoArtifact, ListArtifact, TextArtifact from griptape.memory.meta import ActionSubtaskMetaEntry from griptape.memory.task.storage import BlobArtifactStorage, TextArtifactStorage -from griptape.mixins import ActivityMixin +from griptape.mixins.activity_mixin import ActivityMixin if TYPE_CHECKING: from griptape.memory.task.storage import BaseArtifactStorage diff --git a/griptape/mixins/__init__.py b/griptape/mixins/__init__.py index 32e00dd8b9..e69de29bb2 100644 --- a/griptape/mixins/__init__.py +++ b/griptape/mixins/__init__.py @@ -1,19 +0,0 @@ -from .activity_mixin import ActivityMixin -from .exponential_backoff_mixin import ExponentialBackoffMixin -from .actions_subtask_origin_mixin import ActionsSubtaskOriginMixin -from .rule_mixin import RuleMixin -from .serializable_mixin import SerializableMixin -from .media_artifact_file_output_mixin import BlobArtifactFileOutputMixin -from .futures_executor_mixin import FuturesExecutorMixin -from .singleton_mixin import SingletonMixin - -__all__ = [ - "ActivityMixin", - "ExponentialBackoffMixin", - "ActionsSubtaskOriginMixin", - "RuleMixin", - "BlobArtifactFileOutputMixin", - "SerializableMixin", - "FuturesExecutorMixin", - "SingletonMixin", -] diff --git a/griptape/schemas/base_schema.py b/griptape/schemas/base_schema.py index f25e8870b7..9290c60981 100644 --- a/griptape/schemas/base_schema.py +++ b/griptape/schemas/base_schema.py @@ -25,7 +25,7 @@ def from_attrs_cls(cls, attrs_cls: type) -> type: """ from marshmallow import post_load - from griptape.mixins import SerializableMixin + from griptape.mixins.serializable_mixin import SerializableMixin class SubSchema(cls): @post_load diff --git a/griptape/structures/workflow.py b/griptape/structures/workflow.py index f1e1ec86b2..cd7bef07d7 100644 --- a/griptape/structures/workflow.py +++ b/griptape/structures/workflow.py @@ -9,7 +9,7 @@ from griptape.artifacts import ErrorArtifact from griptape.common import observable from griptape.memory.structure import Run -from griptape.mixins import FuturesExecutorMixin +from griptape.mixins.futures_executor_mixin import FuturesExecutorMixin from griptape.structures import Structure if TYPE_CHECKING: diff --git a/griptape/tasks/actions_subtask.py b/griptape/tasks/actions_subtask.py index 7cdb5d4de0..38a96a6038 100644 --- a/griptape/tasks/actions_subtask.py +++ b/griptape/tasks/actions_subtask.py @@ -13,7 +13,7 @@ from griptape.common import ToolAction from griptape.configs import Defaults from griptape.events import EventBus, FinishActionsSubtaskEvent, StartActionsSubtaskEvent -from griptape.mixins import ActionsSubtaskOriginMixin +from griptape.mixins.actions_subtask_origin_mixin import ActionsSubtaskOriginMixin from griptape.tasks import BaseTask from griptape.utils import remove_null_values_in_dict_recursively diff --git a/griptape/tasks/base_audio_generation_task.py b/griptape/tasks/base_audio_generation_task.py index 519a1a59ab..fae217d54e 100644 --- a/griptape/tasks/base_audio_generation_task.py +++ b/griptape/tasks/base_audio_generation_task.py @@ -6,7 +6,8 @@ from attrs import define from griptape.configs import Defaults -from griptape.mixins import BlobArtifactFileOutputMixin, RuleMixin +from griptape.mixins.media_artifact_file_output_mixin import BlobArtifactFileOutputMixin +from griptape.mixins.rule_mixin import RuleMixin from griptape.tasks import BaseTask logger = logging.getLogger(Defaults.logging_config.logger_name) diff --git a/griptape/tasks/base_audio_input_task.py b/griptape/tasks/base_audio_input_task.py index e39f70fcd7..8a834db566 100644 --- a/griptape/tasks/base_audio_input_task.py +++ b/griptape/tasks/base_audio_input_task.py @@ -8,7 +8,7 @@ from griptape.artifacts.audio_artifact import AudioArtifact from griptape.configs import Defaults -from griptape.mixins import RuleMixin +from griptape.mixins.rule_mixin import RuleMixin from griptape.tasks import BaseTask logger = logging.getLogger(Defaults.logging_config.logger_name) diff --git a/griptape/tasks/base_image_generation_task.py b/griptape/tasks/base_image_generation_task.py index f0c1f0e7e5..bd36d00803 100644 --- a/griptape/tasks/base_image_generation_task.py +++ b/griptape/tasks/base_image_generation_task.py @@ -10,7 +10,8 @@ from griptape.configs import Defaults from griptape.loaders import ImageLoader -from griptape.mixins import BlobArtifactFileOutputMixin, RuleMixin +from griptape.mixins.media_artifact_file_output_mixin import BlobArtifactFileOutputMixin +from griptape.mixins.rule_mixin import RuleMixin from griptape.rules import Rule, Ruleset from griptape.tasks import BaseTask diff --git a/griptape/tasks/base_task.py b/griptape/tasks/base_task.py index 535b3a92d4..2c67430359 100644 --- a/griptape/tasks/base_task.py +++ b/griptape/tasks/base_task.py @@ -11,7 +11,7 @@ from griptape.artifacts import ErrorArtifact from griptape.configs import Defaults from griptape.events import EventBus, FinishTaskEvent, StartTaskEvent -from griptape.mixins import FuturesExecutorMixin +from griptape.mixins.futures_executor_mixin import FuturesExecutorMixin if TYPE_CHECKING: from griptape.artifacts import BaseArtifact diff --git a/griptape/tasks/prompt_task.py b/griptape/tasks/prompt_task.py index 9c00600393..d2dd20b36f 100644 --- a/griptape/tasks/prompt_task.py +++ b/griptape/tasks/prompt_task.py @@ -8,7 +8,7 @@ from griptape.artifacts import BaseArtifact, ListArtifact, TextArtifact from griptape.common import PromptStack from griptape.configs import Defaults -from griptape.mixins import RuleMixin +from griptape.mixins.rule_mixin import RuleMixin from griptape.tasks import BaseTask from griptape.utils import J2 diff --git a/griptape/tasks/tool_task.py b/griptape/tasks/tool_task.py index 6dd5000b31..2dcb796d83 100644 --- a/griptape/tasks/tool_task.py +++ b/griptape/tasks/tool_task.py @@ -8,7 +8,7 @@ from griptape import utils from griptape.artifacts import BaseArtifact, ErrorArtifact, InfoArtifact, ListArtifact -from griptape.mixins import ActionsSubtaskOriginMixin +from griptape.mixins.actions_subtask_origin_mixin import ActionsSubtaskOriginMixin from griptape.tasks import ActionsSubtask, PromptTask from griptape.utils import J2 diff --git a/griptape/tasks/toolkit_task.py b/griptape/tasks/toolkit_task.py index ff11944406..ed9860c660 100644 --- a/griptape/tasks/toolkit_task.py +++ b/griptape/tasks/toolkit_task.py @@ -8,7 +8,7 @@ from griptape import utils from griptape.artifacts import ActionArtifact, BaseArtifact, ErrorArtifact, ListArtifact, TextArtifact from griptape.common import PromptStack, ToolAction -from griptape.mixins import ActionsSubtaskOriginMixin +from griptape.mixins.actions_subtask_origin_mixin import ActionsSubtaskOriginMixin from griptape.tasks import ActionsSubtask, PromptTask from griptape.utils import J2 diff --git a/griptape/tools/base_image_generation_tool.py b/griptape/tools/base_image_generation_tool.py index 487c6d1ba4..ee1c37b6df 100644 --- a/griptape/tools/base_image_generation_tool.py +++ b/griptape/tools/base_image_generation_tool.py @@ -1,6 +1,6 @@ from attrs import define -from griptape.mixins import BlobArtifactFileOutputMixin +from griptape.mixins.media_artifact_file_output_mixin import BlobArtifactFileOutputMixin from griptape.tools import BaseTool diff --git a/griptape/tools/base_tool.py b/griptape/tools/base_tool.py index 7c6785649e..b846ec40b3 100644 --- a/griptape/tools/base_tool.py +++ b/griptape/tools/base_tool.py @@ -16,7 +16,7 @@ from griptape.artifacts import BaseArtifact, ErrorArtifact, InfoArtifact, TextArtifact from griptape.common import observable -from griptape.mixins import ActivityMixin +from griptape.mixins.activity_mixin import ActivityMixin if TYPE_CHECKING: from griptape.common import ToolAction diff --git a/griptape/tools/extraction/tool.py b/griptape/tools/extraction/tool.py index 1f6d06b802..3cb46a6703 100644 --- a/griptape/tools/extraction/tool.py +++ b/griptape/tools/extraction/tool.py @@ -6,7 +6,7 @@ from schema import Literal, Or, Schema from griptape.artifacts import ErrorArtifact, ListArtifact, TextArtifact -from griptape.mixins import RuleMixin +from griptape.mixins.rule_mixin import RuleMixin from griptape.tools import BaseTool from griptape.utils.decorators import activity diff --git a/griptape/tools/text_to_speech/tool.py b/griptape/tools/text_to_speech/tool.py index 95a42d0aef..ea49820296 100644 --- a/griptape/tools/text_to_speech/tool.py +++ b/griptape/tools/text_to_speech/tool.py @@ -5,7 +5,7 @@ from attrs import define, field from schema import Literal, Schema -from griptape.mixins import BlobArtifactFileOutputMixin +from griptape.mixins.media_artifact_file_output_mixin import BlobArtifactFileOutputMixin from griptape.tools import BaseTool from griptape.utils.decorators import activity diff --git a/tests/mocks/mock_futures_executor.py b/tests/mocks/mock_futures_executor.py index cbbf845604..30dcfc21e5 100644 --- a/tests/mocks/mock_futures_executor.py +++ b/tests/mocks/mock_futures_executor.py @@ -1,4 +1,4 @@ -from griptape.mixins import FuturesExecutorMixin +from griptape.mixins.futures_executor_mixin import FuturesExecutorMixin class MockFuturesExecutor(FuturesExecutorMixin): ... diff --git a/tests/mocks/mock_serializable.py b/tests/mocks/mock_serializable.py index b40ae25b4c..9a838f9b59 100644 --- a/tests/mocks/mock_serializable.py +++ b/tests/mocks/mock_serializable.py @@ -4,7 +4,7 @@ from attrs import define, field -from griptape.mixins import SerializableMixin +from griptape.mixins.serializable_mixin import SerializableMixin @define diff --git a/tests/unit/mixins/test_image_artifact_file_output_mixin.py b/tests/unit/mixins/test_image_artifact_file_output_mixin.py index 03c44e081b..cf124da395 100644 --- a/tests/unit/mixins/test_image_artifact_file_output_mixin.py +++ b/tests/unit/mixins/test_image_artifact_file_output_mixin.py @@ -4,7 +4,7 @@ import pytest from griptape.artifacts import ImageArtifact -from griptape.mixins import BlobArtifactFileOutputMixin +from griptape.mixins.media_artifact_file_output_mixin import BlobArtifactFileOutputMixin class TestMediaArtifactFileOutputMixin: diff --git a/tests/unit/mixins/test_rule_mixin.py b/tests/unit/mixins/test_rule_mixin.py index e880145660..393d721a3f 100644 --- a/tests/unit/mixins/test_rule_mixin.py +++ b/tests/unit/mixins/test_rule_mixin.py @@ -1,6 +1,6 @@ import pytest -from griptape.mixins import RuleMixin +from griptape.mixins.rule_mixin import RuleMixin from griptape.rules import Rule, Ruleset from griptape.structures import Agent from griptape.tasks import PromptTask