Skip to content

drivers

__all__ = ['BaseDriversConfig', 'DriversConfig', 'OpenAiDriversConfig', 'AzureOpenAiDriversConfig', 'AmazonBedrockDriversConfig', 'AnthropicDriversConfig', 'GoogleDriversConfig', 'CohereDriversConfig'] module-attribute

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 image_query_driver(self) -> AmazonBedrockImageQueryDriver:
        return AmazonBedrockImageQueryDriver(
            session=self.session,
            model="anthropic.claude-3-5-sonnet-20240620-v1:0",
            image_query_model_driver=BedrockClaudeImageQueryModelDriver(),
        )

    @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(),
    )

image_query_driver()

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

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")
    )

AnthropicDriversConfig

Bases: DriversConfig

Source code in griptape/configs/drivers/anthropic_drivers_config.py
@define
class AnthropicDriversConfig(DriversConfig):
    @lazy_property()
    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")

embedding_driver()

Source code in griptape/configs/drivers/anthropic_drivers_config.py
@lazy_property()
def embedding_driver(self) -> VoyageAiEmbeddingDriver:
    return VoyageAiEmbeddingDriver(model="voyage-large-2")

image_query_driver()

Source code in griptape/configs/drivers/anthropic_drivers_config.py
@lazy_property()
def image_query_driver(self) -> AnthropicImageQueryDriver:
    return AnthropicImageQueryDriver(model="claude-3-5-sonnet-20240620")

prompt_driver()

Source code in griptape/configs/drivers/anthropic_drivers_config.py
@lazy_property()
def prompt_driver(self) -> AnthropicPromptDriver:
    return AnthropicPromptDriver(model="claude-3-5-sonnet-20240620")

vector_store_driver()

Source code in griptape/configs/drivers/anthropic_drivers_config.py
@lazy_property()
def vector_store_driver(self) -> LocalVectorStoreDriver:
    return LocalVectorStoreDriver(embedding_driver=VoyageAiEmbeddingDriver(model="voyage-large-2"))

AzureOpenAiDriversConfig

Bases: DriversConfig

Azure OpenAI Drivers Configuration.

Attributes:

Name Type Description
azure_endpoint str

The endpoint for the Azure OpenAI instance.

azure_ad_token Optional[str]

An optional Azure Active Directory token.

azure_ad_token_provider Optional[Callable[[], str]]

An optional Azure Active Directory token provider.

api_key Optional[str]

An optional Azure API key.

prompt_driver AzureOpenAiChatPromptDriver

An Azure OpenAI Chat Prompt Driver.

image_generation_driver AzureOpenAiImageGenerationDriver

An Azure OpenAI Image Generation Driver.

image_query_driver AzureOpenAiImageQueryDriver

An Azure OpenAI Vision Image Query Driver.

embedding_driver AzureOpenAiEmbeddingDriver

An Azure OpenAI Embedding Driver.

vector_store_driver LocalVectorStoreDriver

A Local Vector Store Driver.

Source code in griptape/configs/drivers/azure_openai_drivers_config.py
@define
class AzureOpenAiDriversConfig(DriversConfig):
    """Azure OpenAI Drivers Configuration.

    Attributes:
        azure_endpoint: The endpoint for the Azure OpenAI instance.
        azure_ad_token: An optional Azure Active Directory token.
        azure_ad_token_provider: An optional Azure Active Directory token provider.
        api_key: An optional Azure API key.
        prompt_driver: An Azure OpenAI Chat Prompt Driver.
        image_generation_driver: An Azure OpenAI Image Generation Driver.
        image_query_driver: An Azure OpenAI Vision Image Query Driver.
        embedding_driver: An Azure OpenAI Embedding Driver.
        vector_store_driver: A Local Vector Store Driver.
    """

    azure_endpoint: str = field(kw_only=True, metadata={"serializable": True})
    azure_ad_token: Optional[str] = field(kw_only=True, default=None, metadata={"serializable": False})
    azure_ad_token_provider: Optional[Callable[[], str]] = field(
        kw_only=True,
        default=None,
        metadata={"serializable": False},
    )
    api_key: Optional[str] = field(kw_only=True, default=None, metadata={"serializable": False})

    @lazy_property()
    def prompt_driver(self) -> AzureOpenAiChatPromptDriver:
        return AzureOpenAiChatPromptDriver(
            model="gpt-4o",
            azure_endpoint=self.azure_endpoint,
            api_key=self.api_key,
            azure_ad_token=self.azure_ad_token,
            azure_ad_token_provider=self.azure_ad_token_provider,
        )

    @lazy_property()
    def embedding_driver(self) -> AzureOpenAiEmbeddingDriver:
        return AzureOpenAiEmbeddingDriver(
            model="text-embedding-3-small",
            azure_endpoint=self.azure_endpoint,
            api_key=self.api_key,
            azure_ad_token=self.azure_ad_token,
            azure_ad_token_provider=self.azure_ad_token_provider,
        )

    @lazy_property()
    def image_generation_driver(self) -> AzureOpenAiImageGenerationDriver:
        return AzureOpenAiImageGenerationDriver(
            model="dall-e-2",
            azure_endpoint=self.azure_endpoint,
            api_key=self.api_key,
            azure_ad_token=self.azure_ad_token,
            azure_ad_token_provider=self.azure_ad_token_provider,
            image_size="512x512",
        )

    @lazy_property()
    def image_query_driver(self) -> AzureOpenAiImageQueryDriver:
        return AzureOpenAiImageQueryDriver(
            model="gpt-4o",
            azure_endpoint=self.azure_endpoint,
            api_key=self.api_key,
            azure_ad_token=self.azure_ad_token,
            azure_ad_token_provider=self.azure_ad_token_provider,
        )

    @lazy_property()
    def vector_store_driver(self) -> LocalVectorStoreDriver:
        return LocalVectorStoreDriver(
            embedding_driver=AzureOpenAiEmbeddingDriver(
                model="text-embedding-3-small",
                azure_endpoint=self.azure_endpoint,
                api_key=self.api_key,
                azure_ad_token=self.azure_ad_token,
                azure_ad_token_provider=self.azure_ad_token_provider,
            )
        )

    @lazy_property()
    def text_to_speech_driver(self) -> AzureOpenAiTextToSpeechDriver:
        return AzureOpenAiTextToSpeechDriver(
            model="tts",
            azure_endpoint=self.azure_endpoint,
            api_key=self.api_key,
            azure_ad_token=self.azure_ad_token,
            azure_ad_token_provider=self.azure_ad_token_provider,
        )

api_key: Optional[str] = field(kw_only=True, default=None, metadata={'serializable': False}) class-attribute instance-attribute

azure_ad_token: Optional[str] = field(kw_only=True, default=None, metadata={'serializable': False}) class-attribute instance-attribute

azure_ad_token_provider: Optional[Callable[[], str]] = field(kw_only=True, default=None, metadata={'serializable': False}) class-attribute instance-attribute

azure_endpoint: str = field(kw_only=True, metadata={'serializable': True}) class-attribute instance-attribute

embedding_driver()

Source code in griptape/configs/drivers/azure_openai_drivers_config.py
@lazy_property()
def embedding_driver(self) -> AzureOpenAiEmbeddingDriver:
    return AzureOpenAiEmbeddingDriver(
        model="text-embedding-3-small",
        azure_endpoint=self.azure_endpoint,
        api_key=self.api_key,
        azure_ad_token=self.azure_ad_token,
        azure_ad_token_provider=self.azure_ad_token_provider,
    )

image_generation_driver()

Source code in griptape/configs/drivers/azure_openai_drivers_config.py
@lazy_property()
def image_generation_driver(self) -> AzureOpenAiImageGenerationDriver:
    return AzureOpenAiImageGenerationDriver(
        model="dall-e-2",
        azure_endpoint=self.azure_endpoint,
        api_key=self.api_key,
        azure_ad_token=self.azure_ad_token,
        azure_ad_token_provider=self.azure_ad_token_provider,
        image_size="512x512",
    )

image_query_driver()

Source code in griptape/configs/drivers/azure_openai_drivers_config.py
@lazy_property()
def image_query_driver(self) -> AzureOpenAiImageQueryDriver:
    return AzureOpenAiImageQueryDriver(
        model="gpt-4o",
        azure_endpoint=self.azure_endpoint,
        api_key=self.api_key,
        azure_ad_token=self.azure_ad_token,
        azure_ad_token_provider=self.azure_ad_token_provider,
    )

prompt_driver()

Source code in griptape/configs/drivers/azure_openai_drivers_config.py
@lazy_property()
def prompt_driver(self) -> AzureOpenAiChatPromptDriver:
    return AzureOpenAiChatPromptDriver(
        model="gpt-4o",
        azure_endpoint=self.azure_endpoint,
        api_key=self.api_key,
        azure_ad_token=self.azure_ad_token,
        azure_ad_token_provider=self.azure_ad_token_provider,
    )

text_to_speech_driver()

Source code in griptape/configs/drivers/azure_openai_drivers_config.py
@lazy_property()
def text_to_speech_driver(self) -> AzureOpenAiTextToSpeechDriver:
    return AzureOpenAiTextToSpeechDriver(
        model="tts",
        azure_endpoint=self.azure_endpoint,
        api_key=self.api_key,
        azure_ad_token=self.azure_ad_token,
        azure_ad_token_provider=self.azure_ad_token_provider,
    )

vector_store_driver()

Source code in griptape/configs/drivers/azure_openai_drivers_config.py
@lazy_property()
def vector_store_driver(self) -> LocalVectorStoreDriver:
    return LocalVectorStoreDriver(
        embedding_driver=AzureOpenAiEmbeddingDriver(
            model="text-embedding-3-small",
            azure_endpoint=self.azure_endpoint,
            api_key=self.api_key,
            azure_ad_token=self.azure_ad_token,
            azure_ad_token_provider=self.azure_ad_token_provider,
        )
    )

BaseDriversConfig

Bases: ABC, SerializableMixin

Source code in griptape/configs/drivers/base_drivers_config.py
@define
class BaseDriversConfig(ABC, SerializableMixin):
    _prompt_driver: BasePromptDriver = field(
        kw_only=True, default=None, metadata={"serializable": True}, alias="prompt_driver"
    )
    _image_generation_driver: BaseImageGenerationDriver = field(
        kw_only=True, default=None, metadata={"serializable": True}, alias="image_generation_driver"
    )
    _image_query_driver: BaseImageQueryDriver = field(
        kw_only=True, default=None, metadata={"serializable": True}, alias="image_query_driver"
    )
    _embedding_driver: BaseEmbeddingDriver = field(
        kw_only=True, default=None, metadata={"serializable": True}, alias="embedding_driver"
    )
    _vector_store_driver: BaseVectorStoreDriver = field(
        default=None, kw_only=True, metadata={"serializable": True}, alias="vector_store_driver"
    )
    _conversation_memory_driver: BaseConversationMemoryDriver = field(
        default=None, kw_only=True, metadata={"serializable": True}, alias="conversation_memory_driver"
    )
    _text_to_speech_driver: BaseTextToSpeechDriver = field(
        default=None, kw_only=True, metadata={"serializable": True}, alias="text_to_speech_driver"
    )
    _audio_transcription_driver: BaseAudioTranscriptionDriver = field(
        default=None, kw_only=True, metadata={"serializable": True}, alias="audio_transcription_driver"
    )

    _last_drivers_config: Optional[BaseDriversConfig] = field(default=None)

    def __enter__(self) -> BaseDriversConfig:
        from griptape.configs import Defaults

        self._last_drivers_config = Defaults.drivers_config

        Defaults.drivers_config = self

        return self

    def __exit__(self, type, value, traceback) -> None:  # noqa: ANN001, A002
        from griptape.configs import Defaults

        if self._last_drivers_config is not None:
            Defaults.drivers_config = self._last_drivers_config

        self._last_drivers_config = None

    @lazy_property()
    @abstractmethod
    def prompt_driver(self) -> BasePromptDriver: ...

    @lazy_property()
    @abstractmethod
    def image_generation_driver(self) -> BaseImageGenerationDriver: ...

    @lazy_property()
    @abstractmethod
    def image_query_driver(self) -> BaseImageQueryDriver: ...

    @lazy_property()
    @abstractmethod
    def embedding_driver(self) -> BaseEmbeddingDriver: ...

    @lazy_property()
    @abstractmethod
    def vector_store_driver(self) -> BaseVectorStoreDriver: ...

    @lazy_property()
    @abstractmethod
    def conversation_memory_driver(self) -> BaseConversationMemoryDriver: ...

    @lazy_property()
    @abstractmethod
    def text_to_speech_driver(self) -> BaseTextToSpeechDriver: ...

    @lazy_property()
    @abstractmethod
    def audio_transcription_driver(self) -> BaseAudioTranscriptionDriver: ...

__enter__()

Source code in griptape/configs/drivers/base_drivers_config.py
def __enter__(self) -> BaseDriversConfig:
    from griptape.configs import Defaults

    self._last_drivers_config = Defaults.drivers_config

    Defaults.drivers_config = self

    return self

__exit__(type, value, traceback)

Source code in griptape/configs/drivers/base_drivers_config.py
def __exit__(self, type, value, traceback) -> None:  # noqa: ANN001, A002
    from griptape.configs import Defaults

    if self._last_drivers_config is not None:
        Defaults.drivers_config = self._last_drivers_config

    self._last_drivers_config = None

audio_transcription_driver() abstractmethod

Source code in griptape/configs/drivers/base_drivers_config.py
@lazy_property()
@abstractmethod
def audio_transcription_driver(self) -> BaseAudioTranscriptionDriver: ...

conversation_memory_driver() abstractmethod

Source code in griptape/configs/drivers/base_drivers_config.py
@lazy_property()
@abstractmethod
def conversation_memory_driver(self) -> BaseConversationMemoryDriver: ...

embedding_driver() abstractmethod

Source code in griptape/configs/drivers/base_drivers_config.py
@lazy_property()
@abstractmethod
def embedding_driver(self) -> BaseEmbeddingDriver: ...

image_generation_driver() abstractmethod

Source code in griptape/configs/drivers/base_drivers_config.py
@lazy_property()
@abstractmethod
def image_generation_driver(self) -> BaseImageGenerationDriver: ...

image_query_driver() abstractmethod

Source code in griptape/configs/drivers/base_drivers_config.py
@lazy_property()
@abstractmethod
def image_query_driver(self) -> BaseImageQueryDriver: ...

prompt_driver() abstractmethod

Source code in griptape/configs/drivers/base_drivers_config.py
@lazy_property()
@abstractmethod
def prompt_driver(self) -> BasePromptDriver: ...

text_to_speech_driver() abstractmethod

Source code in griptape/configs/drivers/base_drivers_config.py
@lazy_property()
@abstractmethod
def text_to_speech_driver(self) -> BaseTextToSpeechDriver: ...

vector_store_driver() abstractmethod

Source code in griptape/configs/drivers/base_drivers_config.py
@lazy_property()
@abstractmethod
def vector_store_driver(self) -> BaseVectorStoreDriver: ...

CohereDriversConfig

Bases: DriversConfig

Source code in griptape/configs/drivers/cohere_drivers_config.py
@define
class CohereDriversConfig(DriversConfig):
    api_key: str = field(metadata={"serializable": False}, kw_only=True)

    @lazy_property()
    def prompt_driver(self) -> CoherePromptDriver:
        return CoherePromptDriver(model="command-r", api_key=self.api_key)

    @lazy_property()
    def embedding_driver(self) -> CohereEmbeddingDriver:
        return CohereEmbeddingDriver(
            model="embed-english-v3.0",
            api_key=self.api_key,
            input_type="search_document",
        )

    @lazy_property()
    def vector_store_driver(self) -> LocalVectorStoreDriver:
        return LocalVectorStoreDriver(
            embedding_driver=CohereEmbeddingDriver(
                model="embed-english-v3.0",
                api_key=self.api_key,
                input_type="search_document",
            )
        )

api_key: str = field(metadata={'serializable': False}, kw_only=True) class-attribute instance-attribute

embedding_driver()

Source code in griptape/configs/drivers/cohere_drivers_config.py
@lazy_property()
def embedding_driver(self) -> CohereEmbeddingDriver:
    return CohereEmbeddingDriver(
        model="embed-english-v3.0",
        api_key=self.api_key,
        input_type="search_document",
    )

prompt_driver()

Source code in griptape/configs/drivers/cohere_drivers_config.py
@lazy_property()
def prompt_driver(self) -> CoherePromptDriver:
    return CoherePromptDriver(model="command-r", api_key=self.api_key)

vector_store_driver()

Source code in griptape/configs/drivers/cohere_drivers_config.py
@lazy_property()
def vector_store_driver(self) -> LocalVectorStoreDriver:
    return LocalVectorStoreDriver(
        embedding_driver=CohereEmbeddingDriver(
            model="embed-english-v3.0",
            api_key=self.api_key,
            input_type="search_document",
        )
    )

DriversConfig

Bases: BaseDriversConfig

Source code in griptape/configs/drivers/drivers_config.py
@define
class DriversConfig(BaseDriversConfig):
    @lazy_property()
    def prompt_driver(self) -> BasePromptDriver:
        return DummyPromptDriver()

    @lazy_property()
    def image_generation_driver(self) -> BaseImageGenerationDriver:
        return DummyImageGenerationDriver()

    @lazy_property()
    def image_query_driver(self) -> BaseImageQueryDriver:
        return DummyImageQueryDriver()

    @lazy_property()
    def embedding_driver(self) -> BaseEmbeddingDriver:
        return DummyEmbeddingDriver()

    @lazy_property()
    def vector_store_driver(self) -> BaseVectorStoreDriver:
        return DummyVectorStoreDriver(embedding_driver=self.embedding_driver)

    @lazy_property()
    def conversation_memory_driver(self) -> BaseConversationMemoryDriver:
        return LocalConversationMemoryDriver()

    @lazy_property()
    def text_to_speech_driver(self) -> BaseTextToSpeechDriver:
        return DummyTextToSpeechDriver()

    @lazy_property()
    def audio_transcription_driver(self) -> BaseAudioTranscriptionDriver:
        return DummyAudioTranscriptionDriver()

audio_transcription_driver()

Source code in griptape/configs/drivers/drivers_config.py
@lazy_property()
def audio_transcription_driver(self) -> BaseAudioTranscriptionDriver:
    return DummyAudioTranscriptionDriver()

conversation_memory_driver()

Source code in griptape/configs/drivers/drivers_config.py
@lazy_property()
def conversation_memory_driver(self) -> BaseConversationMemoryDriver:
    return LocalConversationMemoryDriver()

embedding_driver()

Source code in griptape/configs/drivers/drivers_config.py
@lazy_property()
def embedding_driver(self) -> BaseEmbeddingDriver:
    return DummyEmbeddingDriver()

image_generation_driver()

Source code in griptape/configs/drivers/drivers_config.py
@lazy_property()
def image_generation_driver(self) -> BaseImageGenerationDriver:
    return DummyImageGenerationDriver()

image_query_driver()

Source code in griptape/configs/drivers/drivers_config.py
@lazy_property()
def image_query_driver(self) -> BaseImageQueryDriver:
    return DummyImageQueryDriver()

prompt_driver()

Source code in griptape/configs/drivers/drivers_config.py
@lazy_property()
def prompt_driver(self) -> BasePromptDriver:
    return DummyPromptDriver()

text_to_speech_driver()

Source code in griptape/configs/drivers/drivers_config.py
@lazy_property()
def text_to_speech_driver(self) -> BaseTextToSpeechDriver:
    return DummyTextToSpeechDriver()

vector_store_driver()

Source code in griptape/configs/drivers/drivers_config.py
@lazy_property()
def vector_store_driver(self) -> BaseVectorStoreDriver:
    return DummyVectorStoreDriver(embedding_driver=self.embedding_driver)

GoogleDriversConfig

Bases: DriversConfig

Source code in griptape/configs/drivers/google_drivers_config.py
@define
class GoogleDriversConfig(DriversConfig):
    @lazy_property()
    def prompt_driver(self) -> GooglePromptDriver:
        return GooglePromptDriver(model="gemini-1.5-pro")

    @lazy_property()
    def embedding_driver(self) -> GoogleEmbeddingDriver:
        return GoogleEmbeddingDriver(model="models/embedding-001")

    @lazy_property()
    def vector_store_driver(self) -> LocalVectorStoreDriver:
        return LocalVectorStoreDriver(embedding_driver=GoogleEmbeddingDriver(model="models/embedding-001"))

embedding_driver()

Source code in griptape/configs/drivers/google_drivers_config.py
@lazy_property()
def embedding_driver(self) -> GoogleEmbeddingDriver:
    return GoogleEmbeddingDriver(model="models/embedding-001")

prompt_driver()

Source code in griptape/configs/drivers/google_drivers_config.py
@lazy_property()
def prompt_driver(self) -> GooglePromptDriver:
    return GooglePromptDriver(model="gemini-1.5-pro")

vector_store_driver()

Source code in griptape/configs/drivers/google_drivers_config.py
@lazy_property()
def vector_store_driver(self) -> LocalVectorStoreDriver:
    return LocalVectorStoreDriver(embedding_driver=GoogleEmbeddingDriver(model="models/embedding-001"))

OpenAiDriversConfig

Bases: DriversConfig

Source code in griptape/configs/drivers/openai_drivers_config.py
@define
class OpenAiDriversConfig(DriversConfig):
    @lazy_property()
    def prompt_driver(self) -> OpenAiChatPromptDriver:
        return OpenAiChatPromptDriver(model="gpt-4o")

    @lazy_property()
    def image_generation_driver(self) -> OpenAiImageGenerationDriver:
        return OpenAiImageGenerationDriver(model="dall-e-2", image_size="512x512")

    @lazy_property()
    def image_query_driver(self) -> OpenAiImageQueryDriver:
        return OpenAiImageQueryDriver(model="gpt-4o")

    @lazy_property()
    def embedding_driver(self) -> OpenAiEmbeddingDriver:
        return OpenAiEmbeddingDriver(model="text-embedding-3-small")

    @lazy_property()
    def vector_store_driver(self) -> LocalVectorStoreDriver:
        return LocalVectorStoreDriver(embedding_driver=OpenAiEmbeddingDriver(model="text-embedding-3-small"))

    @lazy_property()
    def text_to_speech_driver(self) -> OpenAiTextToSpeechDriver:
        return OpenAiTextToSpeechDriver(model="tts-1")

    @lazy_property()
    def audio_transcription_driver(self) -> OpenAiAudioTranscriptionDriver:
        return OpenAiAudioTranscriptionDriver(model="whisper-1")

audio_transcription_driver()

Source code in griptape/configs/drivers/openai_drivers_config.py
@lazy_property()
def audio_transcription_driver(self) -> OpenAiAudioTranscriptionDriver:
    return OpenAiAudioTranscriptionDriver(model="whisper-1")

embedding_driver()

Source code in griptape/configs/drivers/openai_drivers_config.py
@lazy_property()
def embedding_driver(self) -> OpenAiEmbeddingDriver:
    return OpenAiEmbeddingDriver(model="text-embedding-3-small")

image_generation_driver()

Source code in griptape/configs/drivers/openai_drivers_config.py
@lazy_property()
def image_generation_driver(self) -> OpenAiImageGenerationDriver:
    return OpenAiImageGenerationDriver(model="dall-e-2", image_size="512x512")

image_query_driver()

Source code in griptape/configs/drivers/openai_drivers_config.py
@lazy_property()
def image_query_driver(self) -> OpenAiImageQueryDriver:
    return OpenAiImageQueryDriver(model="gpt-4o")

prompt_driver()

Source code in griptape/configs/drivers/openai_drivers_config.py
@lazy_property()
def prompt_driver(self) -> OpenAiChatPromptDriver:
    return OpenAiChatPromptDriver(model="gpt-4o")

text_to_speech_driver()

Source code in griptape/configs/drivers/openai_drivers_config.py
@lazy_property()
def text_to_speech_driver(self) -> OpenAiTextToSpeechDriver:
    return OpenAiTextToSpeechDriver(model="tts-1")

vector_store_driver()

Source code in griptape/configs/drivers/openai_drivers_config.py
@lazy_property()
def vector_store_driver(self) -> LocalVectorStoreDriver:
    return LocalVectorStoreDriver(embedding_driver=OpenAiEmbeddingDriver(model="text-embedding-3-small"))