Skip to content

cohere_drivers_config

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