amazon_bedrock
__all__ = ['AmazonBedrockTitanEmbeddingDriver', 'AmazonBedrockCohereEmbeddingDriver']
module-attribute
AmazonBedrockCohereEmbeddingDriver
Bases: BaseEmbeddingDriver
Amazon Bedrock Cohere Embedding Driver.
Attributes:
Name | Type | Description |
---|---|---|
model |
str
|
Embedding model name. Defaults to DEFAULT_MODEL. |
input_type |
str
|
Defaults to |
session |
Session
|
Optionally provide custom |
tokenizer |
BaseTokenizer
|
Optionally provide custom |
client |
BedrockClient
|
Optionally provide custom |
Source code in griptape/drivers/embedding/amazon_bedrock_cohere_embedding_driver.py
DEFAULT_MODEL = 'cohere.embed-english-v3'
class-attribute
instance-attribute
input_type: str = field(default='search_query', kw_only=True)
class-attribute
instance-attribute
model: str = field(default=DEFAULT_MODEL, kw_only=True)
class-attribute
instance-attribute
session: boto3.Session = field(default=Factory(lambda: import_optional_dependency('boto3').Session()), kw_only=True)
class-attribute
instance-attribute
tokenizer: BaseTokenizer = field(default=Factory(lambda self: AmazonBedrockTokenizer(model=self.model), takes_self=True), kw_only=True)
class-attribute
instance-attribute
client()
try_embed_chunk(chunk)
Source code in griptape/drivers/embedding/amazon_bedrock_cohere_embedding_driver.py
AmazonBedrockTitanEmbeddingDriver
Bases: BaseEmbeddingDriver
Amazon Bedrock Titan Embedding Driver.
Attributes:
Name | Type | Description |
---|---|---|
model |
str
|
Embedding model name. Defaults to DEFAULT_MODEL. |
tokenizer |
BaseTokenizer
|
Optionally provide custom |
session |
Session
|
Optionally provide custom |
client |
BedrockClient
|
Optionally provide custom |