Skip to content

amazon_bedrock_drivers_config

AmazonBedrockDriversConfig

Bases: DriversConfig

Source code in griptape/configs/drivers/amazon_bedrock_drivers_config.py
@define
class AmazonBedrockDriversConfig(DriversConfig):
    session: boto3.Session = field(
        default=Factory(lambda: import_optional_dependency("boto3").Session()),
        kw_only=True,
        metadata={"serializable": False},
    )

    @lazy_property()
    def prompt_driver(self) -> AmazonBedrockPromptDriver:
        return AmazonBedrockPromptDriver(session=self.session, model="anthropic.claude-3-5-sonnet-20240620-v1:0")

    @lazy_property()
    def embedding_driver(self) -> AmazonBedrockTitanEmbeddingDriver:
        return AmazonBedrockTitanEmbeddingDriver(session=self.session, model="amazon.titan-embed-text-v1")

    @lazy_property()
    def image_generation_driver(self) -> AmazonBedrockImageGenerationDriver:
        return AmazonBedrockImageGenerationDriver(
            session=self.session,
            model="amazon.titan-image-generator-v1",
            image_generation_model_driver=BedrockTitanImageGenerationModelDriver(),
        )

    @lazy_property()
    def vector_store_driver(self) -> LocalVectorStoreDriver:
        return LocalVectorStoreDriver(
            embedding_driver=AmazonBedrockTitanEmbeddingDriver(session=self.session, model="amazon.titan-embed-text-v1")
        )

session: boto3.Session = field(default=Factory(lambda: import_optional_dependency('boto3').Session()), kw_only=True, metadata={'serializable': False}) class-attribute instance-attribute

embedding_driver()

Source code in griptape/configs/drivers/amazon_bedrock_drivers_config.py
@lazy_property()
def embedding_driver(self) -> AmazonBedrockTitanEmbeddingDriver:
    return AmazonBedrockTitanEmbeddingDriver(session=self.session, model="amazon.titan-embed-text-v1")

image_generation_driver()

Source code in griptape/configs/drivers/amazon_bedrock_drivers_config.py
@lazy_property()
def image_generation_driver(self) -> AmazonBedrockImageGenerationDriver:
    return AmazonBedrockImageGenerationDriver(
        session=self.session,
        model="amazon.titan-image-generator-v1",
        image_generation_model_driver=BedrockTitanImageGenerationModelDriver(),
    )

prompt_driver()

Source code in griptape/configs/drivers/amazon_bedrock_drivers_config.py
@lazy_property()
def prompt_driver(self) -> AmazonBedrockPromptDriver:
    return AmazonBedrockPromptDriver(session=self.session, model="anthropic.claude-3-5-sonnet-20240620-v1:0")

vector_store_driver()

Source code in griptape/configs/drivers/amazon_bedrock_drivers_config.py
@lazy_property()
def vector_store_driver(self) -> LocalVectorStoreDriver:
    return LocalVectorStoreDriver(
        embedding_driver=AmazonBedrockTitanEmbeddingDriver(session=self.session, model="amazon.titan-embed-text-v1")
    )