drivers
__all__ = ['BasePromptDriver', 'OpenAiChatPromptDriver', 'AzureOpenAiChatPromptDriver', 'CoherePromptDriver', 'HuggingFacePipelinePromptDriver', 'HuggingFaceHubPromptDriver', 'AnthropicPromptDriver', 'AmazonSageMakerJumpstartPromptDriver', 'AmazonBedrockPromptDriver', 'GooglePromptDriver', 'DummyPromptDriver', 'OllamaPromptDriver', 'BaseConversationMemoryDriver', 'LocalConversationMemoryDriver', 'AmazonDynamoDbConversationMemoryDriver', 'RedisConversationMemoryDriver', 'GriptapeCloudConversationMemoryDriver', 'BaseEmbeddingDriver', 'OpenAiEmbeddingDriver', 'AzureOpenAiEmbeddingDriver', 'AmazonSageMakerJumpstartEmbeddingDriver', 'AmazonBedrockTitanEmbeddingDriver', 'AmazonBedrockCohereEmbeddingDriver', 'VoyageAiEmbeddingDriver', 'HuggingFaceHubEmbeddingDriver', 'GoogleEmbeddingDriver', 'DummyEmbeddingDriver', 'CohereEmbeddingDriver', 'OllamaEmbeddingDriver', 'BaseVectorStoreDriver', 'LocalVectorStoreDriver', 'PineconeVectorStoreDriver', 'MarqoVectorStoreDriver', 'MongoDbAtlasVectorStoreDriver', 'AzureMongoDbVectorStoreDriver', 'RedisVectorStoreDriver', 'OpenSearchVectorStoreDriver', 'AmazonOpenSearchVectorStoreDriver', 'PgVectorVectorStoreDriver', 'QdrantVectorStoreDriver', 'AstraDbVectorStoreDriver', 'DummyVectorStoreDriver', 'GriptapeCloudKnowledgeBaseVectorStoreDriver', 'BaseSqlDriver', 'AmazonRedshiftSqlDriver', 'SnowflakeSqlDriver', 'SqlDriver', 'BaseImageGenerationModelDriver', 'BedrockStableDiffusionImageGenerationModelDriver', 'BedrockTitanImageGenerationModelDriver', 'BaseDiffusionImageGenerationPipelineDriver', 'StableDiffusion3ImageGenerationPipelineDriver', 'StableDiffusion3Img2ImgImageGenerationPipelineDriver', 'StableDiffusion3ControlNetImageGenerationPipelineDriver', 'BaseImageGenerationDriver', 'BaseMultiModelImageGenerationDriver', 'OpenAiImageGenerationDriver', 'LeonardoImageGenerationDriver', 'AmazonBedrockImageGenerationDriver', 'AzureOpenAiImageGenerationDriver', 'DummyImageGenerationDriver', 'HuggingFacePipelineImageGenerationDriver', 'BaseImageQueryModelDriver', 'BedrockClaudeImageQueryModelDriver', 'BaseImageQueryDriver', 'OpenAiImageQueryDriver', 'AzureOpenAiImageQueryDriver', 'DummyImageQueryDriver', 'AnthropicImageQueryDriver', 'BaseMultiModelImageQueryDriver', 'AmazonBedrockImageQueryDriver', 'BaseWebScraperDriver', 'TrafilaturaWebScraperDriver', 'MarkdownifyWebScraperDriver', 'ProxyWebScraperDriver', 'BaseWebSearchDriver', 'GoogleWebSearchDriver', 'DuckDuckGoWebSearchDriver', 'ExaWebSearchDriver', 'TavilyWebSearchDriver', 'BaseEventListenerDriver', 'AmazonSqsEventListenerDriver', 'WebhookEventListenerDriver', 'AwsIotCoreEventListenerDriver', 'GriptapeCloudEventListenerDriver', 'PusherEventListenerDriver', 'BaseFileManagerDriver', 'LocalFileManagerDriver', 'AmazonS3FileManagerDriver', 'BaseRerankDriver', 'CohereRerankDriver', 'BaseTextToSpeechDriver', 'DummyTextToSpeechDriver', 'ElevenLabsTextToSpeechDriver', 'OpenAiTextToSpeechDriver', 'AzureOpenAiTextToSpeechDriver', 'BaseStructureRunDriver', 'GriptapeCloudStructureRunDriver', 'LocalStructureRunDriver', 'BaseAudioTranscriptionDriver', 'DummyAudioTranscriptionDriver', 'OpenAiAudioTranscriptionDriver', 'BaseObservabilityDriver', 'NoOpObservabilityDriver', 'OpenTelemetryObservabilityDriver', 'GriptapeCloudObservabilityDriver', 'DatadogObservabilityDriver']
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
AmazonBedrockImageGenerationDriver
Bases: BaseMultiModelImageGenerationDriver
Driver for image generation models provided by Amazon Bedrock.
Attributes:
Name | Type | Description |
---|---|---|
model |
Bedrock model ID. |
|
session |
Session
|
boto3 session. |
client |
BedrockClient
|
Bedrock runtime client. |
image_width |
int
|
Width of output images. Defaults to 512 and must be a multiple of 64. |
image_height |
int
|
Height of output images. Defaults to 512 and must be a multiple of 64. |
seed |
Optional[int]
|
Optionally provide a consistent seed to generation requests, increasing consistency in output. |
Source code in griptape/drivers/image_generation/amazon_bedrock_image_generation_driver.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
image_height: int = field(default=512, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
image_width: int = field(default=512, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
seed: Optional[int] = field(default=None, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
session: boto3.Session = field(default=Factory(lambda: import_optional_dependency('boto3').Session()), kw_only=True)
class-attribute
instance-attribute
client()
try_image_inpainting(prompts, image, mask, negative_prompts=None)
Source code in griptape/drivers/image_generation/amazon_bedrock_image_generation_driver.py
try_image_outpainting(prompts, image, mask, negative_prompts=None)
Source code in griptape/drivers/image_generation/amazon_bedrock_image_generation_driver.py
try_image_variation(prompts, image, negative_prompts=None)
Source code in griptape/drivers/image_generation/amazon_bedrock_image_generation_driver.py
try_text_to_image(prompts, negative_prompts=None)
Source code in griptape/drivers/image_generation/amazon_bedrock_image_generation_driver.py
AmazonBedrockImageQueryDriver
Bases: BaseMultiModelImageQueryDriver
Source code in griptape/drivers/image_query/amazon_bedrock_image_query_driver.py
session: boto3.Session = field(default=Factory(lambda: import_optional_dependency('boto3').Session()), kw_only=True)
class-attribute
instance-attribute
client()
try_query(query, images)
Source code in griptape/drivers/image_query/amazon_bedrock_image_query_driver.py
AmazonBedrockPromptDriver
Bases: BasePromptDriver
Source code in griptape/drivers/prompt/amazon_bedrock_prompt_driver.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
|
additional_model_request_fields: dict = field(default=Factory(dict), 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
tool_choice: dict = field(default=Factory(lambda: {'auto': {}}), kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
use_native_tools: bool = field(default=True, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
__to_bedrock_message_content(content)
Source code in griptape/drivers/prompt/amazon_bedrock_prompt_driver.py
__to_bedrock_messages(messages)
Source code in griptape/drivers/prompt/amazon_bedrock_prompt_driver.py
__to_bedrock_role(message)
__to_bedrock_tool_use_content(artifact)
Source code in griptape/drivers/prompt/amazon_bedrock_prompt_driver.py
__to_bedrock_tools(tools)
Source code in griptape/drivers/prompt/amazon_bedrock_prompt_driver.py
__to_prompt_stack_delta_message_content(event)
Source code in griptape/drivers/prompt/amazon_bedrock_prompt_driver.py
__to_prompt_stack_message_content(content)
Source code in griptape/drivers/prompt/amazon_bedrock_prompt_driver.py
client()
try_run(prompt_stack)
Source code in griptape/drivers/prompt/amazon_bedrock_prompt_driver.py
try_stream(prompt_stack)
Source code in griptape/drivers/prompt/amazon_bedrock_prompt_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 |
Source code in griptape/drivers/embedding/amazon_bedrock_titan_embedding_driver.py
DEFAULT_MODEL = 'amazon.titan-embed-text-v1'
class-attribute
instance-attribute
model: str = field(default=DEFAULT_MODEL, kw_only=True, metadata={'serializable': 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_titan_embedding_driver.py
AmazonDynamoDbConversationMemoryDriver
Bases: BaseConversationMemoryDriver
Source code in griptape/drivers/memory/conversation/amazon_dynamodb_conversation_memory_driver.py
partition_key: str = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
partition_key_value: str = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
session: boto3.Session = field(default=Factory(lambda: import_optional_dependency('boto3').Session()), kw_only=True)
class-attribute
instance-attribute
sort_key: Optional[str] = field(default=None, metadata={'serializable': True})
class-attribute
instance-attribute
sort_key_value: Optional[str | int] = field(default=None, metadata={'serializable': True})
class-attribute
instance-attribute
table_name: str = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
value_attribute_key: str = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
load()
Source code in griptape/drivers/memory/conversation/amazon_dynamodb_conversation_memory_driver.py
store(runs, metadata)
Source code in griptape/drivers/memory/conversation/amazon_dynamodb_conversation_memory_driver.py
AmazonOpenSearchVectorStoreDriver
Bases: OpenSearchVectorStoreDriver
A Vector Store Driver for Amazon OpenSearch.
Attributes:
Name | Type | Description |
---|---|---|
session |
Session
|
The boto3 session to use. |
service |
str
|
Service name for AWS Signature v4. Values can be 'es' or 'aoss' for for OpenSearch Serverless. Defaults to 'es'. |
http_auth |
str | tuple[str, str]
|
The HTTP authentication credentials to use. Defaults to using credentials in the boto3 session. |
client |
str | tuple[str, str]
|
An optional OpenSearch client to use. Defaults to a new client using the host, port, http_auth, use_ssl, and verify_certs attributes. |
Source code in griptape/drivers/vector/amazon_opensearch_vector_store_driver.py
http_auth: str | tuple[str, str] = field(default=Factory(lambda self: import_optional_dependency('opensearchpy').AWSV4SignerAuth(self.session.get_credentials(), self.session.region_name, self.service), takes_self=True))
class-attribute
instance-attribute
service: str = field(default='es', kw_only=True)
class-attribute
instance-attribute
session: Session = field(default=Factory(lambda: import_optional_dependency('boto3').Session()), kw_only=True)
class-attribute
instance-attribute
upsert_vector(vector, *, vector_id=None, namespace=None, meta=None, **kwargs)
Inserts or updates a vector in OpenSearch.
If a vector with the given vector ID already exists, it is updated; otherwise, a new vector is inserted. Metadata associated with the vector can also be provided.
Source code in griptape/drivers/vector/amazon_opensearch_vector_store_driver.py
AmazonRedshiftSqlDriver
Bases: BaseSqlDriver
Source code in griptape/drivers/sql/amazon_redshift_sql_driver.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
cluster_identifier: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
database: str = field(kw_only=True)
class-attribute
instance-attribute
database_credentials_secret_arn: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
db_user: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
session: boto3.Session = field(kw_only=True)
class-attribute
instance-attribute
wait_for_query_completion_sec: float = field(default=0.3, kw_only=True)
class-attribute
instance-attribute
workgroup_name: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
client()
execute_query(query)
execute_query_raw(query)
Source code in griptape/drivers/sql/amazon_redshift_sql_driver.py
get_table_schema(table_name, schema=None)
Source code in griptape/drivers/sql/amazon_redshift_sql_driver.py
validate_params(_, workgroup_name)
Source code in griptape/drivers/sql/amazon_redshift_sql_driver.py
AmazonS3FileManagerDriver
Bases: BaseFileManagerDriver
AmazonS3FileManagerDriver can be used to list, load, and save files in an Amazon S3 bucket.
Attributes:
Name | Type | Description |
---|---|---|
session |
Session
|
The boto3 session to use for S3 operations. |
bucket |
str
|
The name of the S3 bucket. |
workdir |
str
|
The absolute working directory (must start with "/"). List, load, and save operations will be performed relative to this directory. |
client |
S3Client
|
The S3 client to use for S3 operations. |
Source code in griptape/drivers/file_manager/amazon_s3_file_manager_driver.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
bucket: str = field(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
workdir: str = field(default='/', kw_only=True)
class-attribute
instance-attribute
client()
try_list_files(path)
Source code in griptape/drivers/file_manager/amazon_s3_file_manager_driver.py
try_load_file(path)
Source code in griptape/drivers/file_manager/amazon_s3_file_manager_driver.py
try_save_file(path, value)
Source code in griptape/drivers/file_manager/amazon_s3_file_manager_driver.py
validate_workdir(_, workdir)
Source code in griptape/drivers/file_manager/amazon_s3_file_manager_driver.py
AmazonSageMakerJumpstartEmbeddingDriver
Bases: BaseEmbeddingDriver
Source code in griptape/drivers/embedding/amazon_sagemaker_jumpstart_embedding_driver.py
custom_attributes: str = field(default='accept_eula=true', kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
endpoint: str = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
inference_component_name: Optional[str] = field(default=None, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
session: boto3.Session = field(default=Factory(lambda: import_optional_dependency('boto3').Session()), kw_only=True)
class-attribute
instance-attribute
client()
try_embed_chunk(chunk)
Source code in griptape/drivers/embedding/amazon_sagemaker_jumpstart_embedding_driver.py
AmazonSageMakerJumpstartPromptDriver
Bases: BasePromptDriver
Source code in griptape/drivers/prompt/amazon_sagemaker_jumpstart_prompt_driver.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|