Skip to content

Commit

Permalink
Merge branch 'dev' into feature/driver-config-context
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter authored Sep 11, 2024
2 parents aaf4528 + 9d9b643 commit 94453c7
Show file tree
Hide file tree
Showing 49 changed files with 57 additions and 66 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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.

Expand Down
2 changes: 1 addition & 1 deletion griptape/artifacts/action_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion griptape/artifacts/base_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion griptape/common/actions/base_action.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC

from griptape.mixins import SerializableMixin
from griptape.mixins.serializable_mixin import SerializableMixin


class BaseAction(SerializableMixin, ABC): ...
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion griptape/common/prompt_stack/messages/base_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion griptape/common/prompt_stack/prompt_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion griptape/common/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion griptape/configs/drivers/base_drivers_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion griptape/drivers/embedding/base_embedding_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion griptape/drivers/image_query/base_image_query_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion griptape/drivers/prompt/base_prompt_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion griptape/drivers/vector/base_vector_store_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion griptape/engines/rag/modules/base_rag_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion griptape/engines/rag/rag_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion griptape/engines/rag/stages/base_rag_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion griptape/events/base_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from attrs import Factory, define, field

from griptape.mixins import SerializableMixin
from griptape.mixins.serializable_mixin import SerializableMixin


@define
Expand Down
2 changes: 1 addition & 1 deletion griptape/loaders/base_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion griptape/memory/meta/base_meta_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from attrs import define

from griptape.mixins import SerializableMixin
from griptape.mixins.serializable_mixin import SerializableMixin


@define
Expand Down
2 changes: 1 addition & 1 deletion griptape/memory/structure/base_conversation_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion griptape/memory/structure/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion griptape/memory/task/task_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 0 additions & 19 deletions griptape/mixins/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
]
2 changes: 1 addition & 1 deletion griptape/schemas/base_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion griptape/structures/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion griptape/tasks/actions_subtask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion griptape/tasks/base_audio_generation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion griptape/tasks/base_audio_input_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion griptape/tasks/base_image_generation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion griptape/tasks/base_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion griptape/tasks/prompt_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion griptape/tasks/tool_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion griptape/tasks/toolkit_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion griptape/tools/base_image_generation_tool.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
Loading

0 comments on commit 94453c7

Please sign in to comment.