diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ee9bcee28..3316d19acd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING**: Removed `CompletionChunkEvent`. - If `EventListener.handler` returns `None`, the event will not be published to the `event_listener_driver`. - If `EventListener.handler` is None, the event will be published to the `event_listener_driver` as-is. +- **BREAKING**: `AnthropicDriversConfig` no longer bundles `VoyageAiEmbeddingDriver`. - Updated `EventListener.handler` return type to `Optional[BaseEvent | dict]`. - `BaseTask.parent_outputs` type has changed from `dict[str, str | None]` to `dict[str, BaseArtifact]`. - `Workflow.context["parent_outputs"]` type has changed from `dict[str, str | None]` to `dict[str, BaseArtifact]`. diff --git a/MIGRATION.md b/MIGRATION.md index 41b501870d..60af11fc98 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -2,6 +2,40 @@ This document provides instructions for migrating your codebase to accommodate breaking changes introduced in new versions of Griptape. +## 0.34.X to 0.35.X + +### `AnthropicDriversConfig` Embedding Driver + +`AnthropicDriversConfig` no longer bundles `VoyageAiEmbeddingDriver`. If you rely on embeddings when using Anthropic, you must specify an Embedding Driver yourself. + +#### Before + +```python +from griptape.configs import Defaults +from griptape.configs.drivers import AnthropicDriversConfig +from griptape.structures import Agent + +Defaults.drivers_config = AnthropicDriversConfig() + +agent = Agent() +``` + +#### After + +````python +from griptape.configs import Defaults +from griptape.configs.drivers import AnthropicDriversConfig +from griptape.drivers import VoyageAiEmbeddingDriver, LocalVectorStoreDriver + +Defaults.drivers_config = AnthropicDriversConfig( + embedding_driver=VoyageAiEmbeddingDriver(), + vector_store_driver=LocalVectorStoreDriver( + embedding_driver=VoyageAiEmbeddingDriver() + ) +) +``` + + ## 0.33.X to 0.34.X ### Removed `CompletionChunkEvent` @@ -21,7 +55,7 @@ def handler_fn_stream_text(event: CompletionChunkEvent) -> None: EventListener(handler=handler_fn_stream, event_types=[CompletionChunkEvent]) EventListener(handler=handler_fn_stream_text, event_types=[CompletionChunkEvent]) -``` +```` #### After diff --git a/docs/griptape-framework/structures/configs.md b/docs/griptape-framework/structures/configs.md index 98c58985d5..fa72a13147 100644 --- a/docs/griptape-framework/structures/configs.md +++ b/docs/griptape-framework/structures/configs.md @@ -64,7 +64,6 @@ The [Anthropic Driver config](../../reference/griptape/configs/drivers/anthropic !!! info Anthropic does not provide an embeddings API which means you will need to use another service for embeddings. - The `AnthropicDriversConfig` defaults to using `VoyageAiEmbeddingDriver` which integrates with [VoyageAI](https://www.voyageai.com/), the service used in Anthropic's [embeddings documentation](https://docs.anthropic.com/claude/docs/embeddings). To override the default embedding driver, see: [Override Default Structure Embedding Driver](../drivers/embedding-drivers.md#override-default-structure-embedding-driver). ```python diff --git a/griptape/configs/drivers/anthropic_drivers_config.py b/griptape/configs/drivers/anthropic_drivers_config.py index e5a1f27191..6a0fa52d4d 100644 --- a/griptape/configs/drivers/anthropic_drivers_config.py +++ b/griptape/configs/drivers/anthropic_drivers_config.py @@ -4,8 +4,6 @@ from griptape.drivers import ( AnthropicImageQueryDriver, AnthropicPromptDriver, - LocalVectorStoreDriver, - VoyageAiEmbeddingDriver, ) from griptape.utils.decorators import lazy_property @@ -16,14 +14,6 @@ class AnthropicDriversConfig(DriversConfig): def prompt_driver(self) -> AnthropicPromptDriver: return AnthropicPromptDriver(model="claude-3-5-sonnet-20240620") - @lazy_property() - def embedding_driver(self) -> VoyageAiEmbeddingDriver: - return VoyageAiEmbeddingDriver(model="voyage-large-2") - - @lazy_property() - def vector_store_driver(self) -> LocalVectorStoreDriver: - return LocalVectorStoreDriver(embedding_driver=VoyageAiEmbeddingDriver(model="voyage-large-2")) - @lazy_property() def image_query_driver(self) -> AnthropicImageQueryDriver: return AnthropicImageQueryDriver(model="claude-3-5-sonnet-20240620")