-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a931176
commit f5ae860
Showing
12 changed files
with
296 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,30 @@ | ||
from attrs import Factory, define, field | ||
from attrs import define | ||
|
||
from griptape.config.drivers import DriverConfig | ||
from griptape.drivers import ( | ||
AnthropicImageQueryDriver, | ||
AnthropicPromptDriver, | ||
BaseEmbeddingDriver, | ||
BaseImageQueryDriver, | ||
BasePromptDriver, | ||
BaseVectorStoreDriver, | ||
LocalVectorStoreDriver, | ||
VoyageAiEmbeddingDriver, | ||
) | ||
from griptape.utils.decorators import lazy_property | ||
|
||
|
||
# TODO move class fields to lazy properties | ||
@define | ||
class AnthropicDriverConfig(DriverConfig): | ||
prompt: BasePromptDriver = field( | ||
default=Factory(lambda: AnthropicPromptDriver(model="claude-3-5-sonnet-20240620")), | ||
metadata={"serializable": True}, | ||
kw_only=True, | ||
) | ||
embedding: BaseEmbeddingDriver = field( | ||
default=Factory(lambda: VoyageAiEmbeddingDriver(model="voyage-large-2")), | ||
metadata={"serializable": True}, | ||
kw_only=True, | ||
) | ||
vector_store: BaseVectorStoreDriver = field( | ||
default=Factory( | ||
lambda: LocalVectorStoreDriver(embedding_driver=VoyageAiEmbeddingDriver(model="voyage-large-2")), | ||
), | ||
kw_only=True, | ||
metadata={"serializable": True}, | ||
) | ||
image_query: BaseImageQueryDriver = field( | ||
default=Factory(lambda: AnthropicImageQueryDriver(model="claude-3-5-sonnet-20240620")), | ||
kw_only=True, | ||
metadata={"serializable": True}, | ||
) | ||
@lazy_property | ||
def prompt(self) -> AnthropicPromptDriver: | ||
return AnthropicPromptDriver(model="claude-3-5-sonnet-20240620") | ||
|
||
@lazy_property | ||
def embedding(self) -> VoyageAiEmbeddingDriver: | ||
return VoyageAiEmbeddingDriver(model="voyage-large-2") | ||
|
||
@lazy_property | ||
def vector_store(self) -> LocalVectorStoreDriver: | ||
return LocalVectorStoreDriver(embedding_driver=VoyageAiEmbeddingDriver(model="voyage-large-2")) | ||
|
||
@lazy_property | ||
def image_query(self) -> AnthropicImageQueryDriver: | ||
return AnthropicImageQueryDriver(model="claude-3-5-sonnet-20240620") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.