Tools
__all__ = ['BaseTool', 'BaseAwsClient', 'AwsIamClient', 'AwsS3Client', 'BaseGoogleClient', 'GoogleGmailClient', 'GoogleDocsClient', 'GoogleCalendarClient', 'GoogleDriveClient', 'Calculator', 'WebSearch', 'WebScraper', 'SqlClient', 'EmailClient', 'RestApiClient', 'FileManager', 'VectorStoreClient', 'DateTime', 'TaskMemoryClient', 'Computer', 'OpenWeatherClient', 'PromptImageGenerationClient', 'VariationImageGenerationClient', 'InpaintingImageGenerationClient', 'OutpaintingImageGenerationClient', 'GriptapeCloudKnowledgeBaseClient', 'StructureRunClient', 'ImageQueryClient']
module-attribute
AwsIamClient
Bases: BaseAwsClient
Source code in griptape/tools/aws_iam_client/tool.py
iam_client: Client = field(default=Factory(lambda self: self.session.client('iam'), takes_self=True), kw_only=True)
class-attribute
instance-attribute
get_user_policy(params)
Source code in griptape/tools/aws_iam_client/tool.py
list_mfa_devices(_)
Source code in griptape/tools/aws_iam_client/tool.py
list_user_policies(params)
Source code in griptape/tools/aws_iam_client/tool.py
list_users(_)
Source code in griptape/tools/aws_iam_client/tool.py
AwsS3Client
Bases: BaseAwsClient
Source code in griptape/tools/aws_s3_client/tool.py
14 15 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 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 |
|
s3_client: Client = field(default=Factory(lambda self: self.session.client('s3'), takes_self=True), kw_only=True)
class-attribute
instance-attribute
download_objects(params)
Source code in griptape/tools/aws_s3_client/tool.py
get_bucket_acl(params)
Source code in griptape/tools/aws_s3_client/tool.py
get_bucket_policy(params)
Source code in griptape/tools/aws_s3_client/tool.py
get_object_acl(params)
Source code in griptape/tools/aws_s3_client/tool.py
list_objects(params)
Source code in griptape/tools/aws_s3_client/tool.py
list_s3_buckets(_)
Source code in griptape/tools/aws_s3_client/tool.py
upload_content_to_s3(params)
Source code in griptape/tools/aws_s3_client/tool.py
upload_memory_artifacts_to_s3(params)
Source code in griptape/tools/aws_s3_client/tool.py
BaseAwsClient
Bases: BaseTool
, ABC
Source code in griptape/tools/base_aws_client.py
session: boto3.Session = field(kw_only=True)
class-attribute
instance-attribute
get_current_aws_identity(params)
Source code in griptape/tools/base_aws_client.py
BaseGoogleClient
Bases: BaseTool
, ABC
Source code in griptape/tools/base_google_client.py
DRIVE_AUTH_SCOPES = ['https://www.googleapis.com/auth/drive']
class-attribute
instance-attribute
DRIVE_FILE_SCOPES = ['https://www.googleapis.com/auth/drive.file']
class-attribute
instance-attribute
service_account_credentials: dict = field(kw_only=True)
class-attribute
instance-attribute
BaseTool
Bases: ActivityMixin
, ABC
Abstract class for all tools to inherit from for.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Tool name. |
input_memory |
Optional[list[TaskMemory]]
|
TaskMemory available in tool activities. Gets automatically set if None. |
output_memory |
Optional[dict[str, list[TaskMemory]]]
|
TaskMemory that activities write to be default. Gets automatically set if None. |
install_dependencies_on_init |
bool
|
Determines whether dependencies from the tool requirements.txt file are installed in init. |
dependencies_install_directory |
Optional[str]
|
Custom dependency install directory. |
verbose |
bool
|
Determines whether tool operations (such as dependency installation) should be verbose. |
off_prompt |
bool
|
Determines whether tool activity output goes to the output memory. |
Source code in griptape/tools/base_tool.py
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 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 |
|
MANIFEST_FILE = 'manifest.yml'
class-attribute
instance-attribute
REQUIREMENTS_FILE = 'requirements.txt'
class-attribute
instance-attribute
abs_dir_path
property
abs_file_path
property
class_name
property
dependencies_install_directory: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
input_memory: Optional[list[TaskMemory]] = field(default=None, kw_only=True)
class-attribute
instance-attribute
install_dependencies_on_init: bool = field(default=True, kw_only=True)
class-attribute
instance-attribute
manifest: dict
property
manifest_path: str
property
name: str = field(default=Factory(lambda self: self.class_name, takes_self=True), kw_only=True)
class-attribute
instance-attribute
off_prompt: bool = field(default=True, kw_only=True)
class-attribute
instance-attribute
output_memory: Optional[dict[str, list[TaskMemory]]] = field(default=None, kw_only=True)
class-attribute
instance-attribute
requirements_path: str
property
verbose: bool = field(default=False, kw_only=True)
class-attribute
instance-attribute
__attrs_post_init__()
activity_schemas()
Source code in griptape/tools/base_tool.py
after_run(activity, subtask, action, value)
Source code in griptape/tools/base_tool.py
before_run(activity, subtask, action)
execute(activity, subtask, action)
Source code in griptape/tools/base_tool.py
find_input_memory(memory_name)
install_dependencies(env=None)
Source code in griptape/tools/base_tool.py
run(activity, subtask, action, value)
Source code in griptape/tools/base_tool.py
schema()
tool_dir()
validate()
Source code in griptape/tools/base_tool.py
validate_output_memory(_, output_memory)
Source code in griptape/tools/base_tool.py
Calculator
Bases: BaseTool
Source code in griptape/tools/calculator/tool.py
calculate(params)
Source code in griptape/tools/calculator/tool.py
Computer
Bases: BaseTool
Source code in griptape/tools/computer/tool.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 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 |
|
container_workdir: str = field(default='/griptape', kw_only=True)
class-attribute
instance-attribute
docker_client: DockerClient = field(default=Factory(lambda self: self.default_docker_client(), takes_self=True), kw_only=True)
class-attribute
instance-attribute
dockerfile_path: str = field(default=Factory(lambda self: f'{os.path.join(self.tool_dir(), 'resources/Dockerfile')}', takes_self=True), kw_only=True)
class-attribute
instance-attribute
env_vars: dict = field(factory=dict, kw_only=True)
class-attribute
instance-attribute
local_workdir: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
requirements_txt_path: str = field(default=Factory(lambda self: f'{os.path.join(self.tool_dir(), 'resources/requirements.txt')}', takes_self=True), kw_only=True)
class-attribute
instance-attribute
__attrs_post_init__()
Source code in griptape/tools/computer/tool.py
__del__()
build_image(tool)
Source code in griptape/tools/computer/tool.py
container_name(tool)
default_docker_client()
dependencies()
execute_code(params)
Source code in griptape/tools/computer/tool.py
execute_code_in_container(filename, code)
Source code in griptape/tools/computer/tool.py
execute_command(params)
Source code in griptape/tools/computer/tool.py
execute_command_in_container(command)
Source code in griptape/tools/computer/tool.py
image_name(tool)
install_dependencies(env=None)
remove_existing_container(name)
Source code in griptape/tools/computer/tool.py
validate_docker_client(_, docker_client)
DateTime
Bases: BaseTool
Source code in griptape/tools/date_time/tool.py
get_current_datetime(_)
Source code in griptape/tools/date_time/tool.py
get_relative_datetime(params)
Source code in griptape/tools/date_time/tool.py
EmailClient
Bases: BaseTool
Tool for working with email
Attributes:
Name | Type | Description |
---|---|---|
username |
Optional[str]
|
Username/email address used to send email via the SMTP protocol and retrieve email via the IMAP protocol. Example: bender@futurama.com. |
password |
Optional[str]
|
Password used to send email via the SMTP protocol and retrieve email via the IMAP protocol. If using gmail, this would be an App Password. |
email_max_retrieve_count |
Optional[int]
|
Used to limit the number of messages retrieved during any given activities. |
smtp_host |
Optional[str]
|
Hostname or url of the SMTP server. Example: smtp.gmail.com. Required when using the |
smtp_port |
Optional[int]
|
Port of the SMTP server. Example: 465. Required when using the |
smtp_use_ssl |
bool
|
Whether to use SSL when sending email via the SMTP protocol. |
smtp_user |
Optional[str]
|
Username/email address used to send email via the SMTP protocol. Overrides username for SMTP only. Required when using the |
smtp_password |
Optional[str]
|
Password to send email via the SMTP protocol. Overrides password for SMTP only. Required when using the |
imap_url |
Optional[str]
|
Hostname or url of the IMAP server. Example: imap.gmail.com. Required when using the |
imap_user |
Optional[str]
|
Username/email address used to retrieve email via the IMAP protocol. Overrides username for IMAP only. Required when using the |
imap_password |
Optional[str]
|
Password to retrieve email via the IMAP protocol. Overrides password for IMAP only. Required when using the |
mailboxes |
dict[str, Optional[str]]
|
Descriptions of mailboxes available for retrieving email via the IMAP protocol. Required when using the |
email_loader |
EmailLoader
|
Instance of |
Source code in griptape/tools/email_client/tool.py
15 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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
email_loader: EmailLoader = field(default=Factory(lambda self: EmailLoader(imap_url=self.imap_url, username=self.imap_user, password=self.imap_password), takes_self=True), kw_only=True)
class-attribute
instance-attribute
email_max_retrieve_count: Optional[int] = field(default=None, kw_only=True)
class-attribute
instance-attribute
imap_password: Optional[str] = field(default=Factory(lambda self: self.password, takes_self=True), kw_only=True)
class-attribute
instance-attribute
imap_url: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
imap_user: Optional[str] = field(default=Factory(lambda self: self.username, takes_self=True), kw_only=True)
class-attribute
instance-attribute
mailboxes: dict[str, Optional[str]] = field(default=None, kw_only=True)
class-attribute
instance-attribute
password: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
smtp_host: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
smtp_password: Optional[str] = field(default=Factory(lambda self: self.password, takes_self=True), kw_only=True)
class-attribute
instance-attribute
smtp_port: Optional[int] = field(default=None, kw_only=True)
class-attribute
instance-attribute
smtp_use_ssl: bool = field(default=True, kw_only=True)
class-attribute
instance-attribute
smtp_user: Optional[str] = field(default=Factory(lambda self: self.username, takes_self=True), kw_only=True)
class-attribute
instance-attribute
username: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
retrieve(params)
Source code in griptape/tools/email_client/tool.py
send(params)
Source code in griptape/tools/email_client/tool.py
FileManager
Bases: BaseTool
FileManager is a tool that can be used to list, load, and save files.
Attributes:
Name | Type | Description |
---|---|---|
file_manager_driver |
BaseFileManagerDriver
|
File Manager Driver to use to list, load, and save files. |
Source code in griptape/tools/file_manager/tool.py
11 12 13 14 15 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 116 117 |
|
file_manager_driver: BaseFileManagerDriver = field(default=Factory(lambda: LocalFileManagerDriver()), kw_only=True)
class-attribute
instance-attribute
list_files_from_disk(params)
Source code in griptape/tools/file_manager/tool.py
load_files_from_disk(params)
Source code in griptape/tools/file_manager/tool.py
save_content_to_file(params)
Source code in griptape/tools/file_manager/tool.py
save_memory_artifacts_to_disk(params)
Source code in griptape/tools/file_manager/tool.py
GoogleCalendarClient
Bases: BaseGoogleClient
Source code in griptape/tools/google_cal/tool.py
11 12 13 14 15 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 |
|
CREATE_EVENT_SCOPES = ['https://www.googleapis.com/auth/calendar']
class-attribute
instance-attribute
GET_UPCOMING_EVENTS_SCOPES = ['https://www.googleapis.com/auth/calendar']
class-attribute
instance-attribute
owner_email: str = field(kw_only=True)
class-attribute
instance-attribute
create_event(params)
Source code in griptape/tools/google_cal/tool.py
get_upcoming_events(params)
Source code in griptape/tools/google_cal/tool.py
GoogleDocsClient
Bases: BaseGoogleClient
Source code in griptape/tools/google_docs/tool.py
12 13 14 15 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 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 |
|
DEFAULT_FOLDER_PATH = 'root'
class-attribute
instance-attribute
DOCS_SCOPES = ['https://www.googleapis.com/auth/documents']
class-attribute
instance-attribute
owner_email: str = field(kw_only=True)
class-attribute
instance-attribute
append_text_to_google_doc(params)
Source code in griptape/tools/google_docs/tool.py
prepend_text_to_google_doc(params)
Source code in griptape/tools/google_docs/tool.py
save_content_to_google_doc(params)
Source code in griptape/tools/google_docs/tool.py
save_memory_artifacts_to_google_docs(params)
Source code in griptape/tools/google_docs/tool.py
GoogleDriveClient
Bases: BaseGoogleClient
Source code in griptape/tools/google_drive/tool.py
13 14 15 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 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 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
DEFAULT_FOLDER_PATH = 'root'
class-attribute
instance-attribute
GOOGLE_EXPORT_MIME_MAPPING = {'application/vnd.google-apps.document': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.google-apps.spreadsheet': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.google-apps.presentation': 'application/vnd.openxmlformats-officedocument.presentationml.presentation'}
class-attribute
instance-attribute
LIST_FILES_SCOPES = ['https://www.googleapis.com/auth/drive.readonly']
class-attribute
instance-attribute
SERVICE_NAME = 'drive'
class-attribute
instance-attribute
SERVICE_VERSION = 'v3'
class-attribute
instance-attribute
owner_email: str = field(kw_only=True)
class-attribute
instance-attribute
download_files(params)
Source code in griptape/tools/google_drive/tool.py
list_files(params)
Source code in griptape/tools/google_drive/tool.py
save_content_to_drive(params)
Source code in griptape/tools/google_drive/tool.py
save_memory_artifacts_to_drive(params)
Source code in griptape/tools/google_drive/tool.py
search_files(params)
Source code in griptape/tools/google_drive/tool.py
share_file(params)
Source code in griptape/tools/google_drive/tool.py
GoogleGmailClient
Bases: BaseGoogleClient
Source code in griptape/tools/google_gmail/tool.py
CREATE_DRAFT_EMAIL_SCOPES = ['https://www.googleapis.com/auth/gmail.compose']
class-attribute
instance-attribute
owner_email: str = field(kw_only=True)
class-attribute
instance-attribute
create_draft_email(params)
Source code in griptape/tools/google_gmail/tool.py
GriptapeCloudKnowledgeBaseClient
Bases: BaseGriptapeCloudClient
Attributes:
Name | Type | Description |
---|---|---|
description |
Optional[str]
|
LLM-friendly knowledge base description. |
knowledge_base_id |
str
|
ID of the Griptape Cloud Knowledge Base. |
Source code in griptape/tools/griptape_cloud_knowledge_base_client/tool.py
description: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
knowledge_base_id: str = field(kw_only=True)
class-attribute
instance-attribute
query(params)
Source code in griptape/tools/griptape_cloud_knowledge_base_client/tool.py
ImageQueryClient
Bases: BaseTool
Source code in griptape/tools/image_query_client/tool.py
image_loader: ImageLoader = field(default=Factory(lambda: ImageLoader()), kw_only=True)
class-attribute
instance-attribute
image_query_engine: ImageQueryEngine = field(kw_only=True)
class-attribute
instance-attribute
query_image_from_disk(params)
Source code in griptape/tools/image_query_client/tool.py
query_images_from_memory(params)
Source code in griptape/tools/image_query_client/tool.py
InpaintingImageGenerationClient
Bases: ImageArtifactFileOutputMixin
, BaseTool
A tool that can be used to generate prompted inpaintings of an image.
Attributes:
Name | Type | Description |
---|---|---|
engine |
InpaintingImageGenerationEngine
|
The inpainting image generation engine used to generate the image. |
output_dir |
InpaintingImageGenerationEngine
|
If provided, the generated image will be written to disk in output_dir. |
output_file |
InpaintingImageGenerationEngine
|
If provided, the generated image will be written to disk as output_file. |
Source code in griptape/tools/inpainting_image_generation_client/tool.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 |
|
engine: InpaintingImageGenerationEngine = field(kw_only=True)
class-attribute
instance-attribute
image_loader: ImageLoader = field(default=ImageLoader(), kw_only=True)
class-attribute
instance-attribute
image_inpainting_from_file(params)
Source code in griptape/tools/inpainting_image_generation_client/tool.py
image_inpainting_from_memory(params)
Source code in griptape/tools/inpainting_image_generation_client/tool.py
OpenWeatherClient
Bases: BaseTool
Source code in griptape/tools/openweather_client/tool.py
12 13 14 15 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 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 |
|
BASE_URL = 'https://api.openweathermap.org/data/3.0/onecall'
class-attribute
instance-attribute
GEOCODING_URL = 'https://api.openweathermap.org/geo/1.0/direct'
class-attribute
instance-attribute
US_STATE_CODES = ['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY']
class-attribute
instance-attribute
api_key: str = field(kw_only=True)
class-attribute
instance-attribute
units: str = field(default='imperial', kw_only=True)
class-attribute
instance-attribute
get_coordinates_by_location(params)
Source code in griptape/tools/openweather_client/tool.py
get_current_weather_by_location(params)
Source code in griptape/tools/openweather_client/tool.py
get_daily_forecast_by_location(params)
Source code in griptape/tools/openweather_client/tool.py
get_hourly_forecast_by_location(params)
Source code in griptape/tools/openweather_client/tool.py
OutpaintingImageGenerationClient
Bases: ImageArtifactFileOutputMixin
, BaseTool
A tool that can be used to generate prompted outpaintings of an image.
Attributes:
Name | Type | Description |
---|---|---|
engine |
OutpaintingImageGenerationEngine
|
The outpainting image generation engine used to generate the image. |
output_dir |
OutpaintingImageGenerationEngine
|
If provided, the generated image will be written to disk in output_dir. |
output_file |
OutpaintingImageGenerationEngine
|
If provided, the generated image will be written to disk as output_file. |
Source code in griptape/tools/outpainting_image_generation_client/tool.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 |
|
engine: OutpaintingImageGenerationEngine = field(kw_only=True)
class-attribute
instance-attribute
image_loader: ImageLoader = field(default=ImageLoader(), kw_only=True)
class-attribute
instance-attribute
image_outpainting_from_file(params)
Source code in griptape/tools/outpainting_image_generation_client/tool.py
image_outpainting_from_memory(params)
Source code in griptape/tools/outpainting_image_generation_client/tool.py
PromptImageGenerationClient
Bases: ImageArtifactFileOutputMixin
, BaseTool
A tool that can be used to generate an image from a text prompt.
Attributes:
Name | Type | Description |
---|---|---|
engine |
PromptImageGenerationEngine
|
The prompt image generation engine used to generate the image. |
output_dir |
PromptImageGenerationEngine
|
If provided, the generated image will be written to disk in output_dir. |
output_file |
PromptImageGenerationEngine
|
If provided, the generated image will be written to disk as output_file. |
Source code in griptape/tools/prompt_image_generation_client/tool.py
engine: PromptImageGenerationEngine = field(kw_only=True)
class-attribute
instance-attribute
generate_image(params)
Source code in griptape/tools/prompt_image_generation_client/tool.py
RestApiClient
Bases: BaseTool
Attributes:
Name | Type | Description |
---|---|---|
base_url |
str
|
The base url that will be used for the request. |
path |
Optional[str]
|
The resource path that will be appended to base_url. |
description |
str
|
A description of what the REST API does. |
request_body_schema |
Optional[str]
|
A JSON schema string describing the request body. Recommended for PUT, POST, and PATCH requests. |
request_query_params_schema |
Optional[str]
|
A JSON schema string describing the available query parameters. |
request_path_params_schema |
Optional[str]
|
A JSON schema string describing the available path parameters. The schema must describe an array of string values. |
response_body_schema |
Optional[str]
|
A JSON schema string describing the response body. |
request_headers |
Optional[Dict[str, str]]
|
Headers to include in the requests. |
Source code in griptape/tools/rest_api_client/tool.py
12 13 14 15 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 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 |
|
base_url: str = field(kw_only=True)
class-attribute
instance-attribute
description: str = field(kw_only=True)
class-attribute
instance-attribute
full_url: str
property
path: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
request_body_schema: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
request_headers: Optional[Dict[str, str]] = field(default=None, kw_only=True)
class-attribute
instance-attribute
request_path_params_schema: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
request_query_params_schema: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
response_body_schema: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
delete(params)
Source code in griptape/tools/rest_api_client/tool.py
get(params)
Source code in griptape/tools/rest_api_client/tool.py
patch(params)
Source code in griptape/tools/rest_api_client/tool.py
post(params)
Source code in griptape/tools/rest_api_client/tool.py
put(params)
Source code in griptape/tools/rest_api_client/tool.py
SqlClient
Bases: BaseTool
Source code in griptape/tools/sql_client/tool.py
engine_name: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
full_table_name: str
property
schema_name: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
sql_loader: SqlLoader = field(kw_only=True)
class-attribute
instance-attribute
table_description: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
table_name: str = field(kw_only=True)
class-attribute
instance-attribute
table_schema: Optional[str]
property
execute_query(params)
Source code in griptape/tools/sql_client/tool.py
StructureRunClient
Bases: BaseTool
Attributes:
Name | Type | Description |
---|---|---|
description |
str
|
A description of what the Structure does. |
driver |
BaseStructureRunDriver
|
Driver to run the Structure. |
Source code in griptape/tools/structure_run_client/tool.py
description: str = field(kw_only=True)
class-attribute
instance-attribute
driver: BaseStructureRunDriver = field(kw_only=True)
class-attribute
instance-attribute
run_structure(params)
Source code in griptape/tools/structure_run_client/tool.py
TaskMemoryClient
Bases: BaseTool
Source code in griptape/tools/task_memory_client/tool.py
off_prompt: bool = field(kw_only=True)
class-attribute
instance-attribute
query(params)
Source code in griptape/tools/task_memory_client/tool.py
summarize(params)
Source code in griptape/tools/task_memory_client/tool.py
VariationImageGenerationClient
Bases: ImageArtifactFileOutputMixin
, BaseTool
A tool that can be used to generate prompted variations of an image.
Attributes:
Name | Type | Description |
---|---|---|
engine |
VariationImageGenerationEngine
|
The variation image generation engine used to generate the image. |
output_dir |
VariationImageGenerationEngine
|
If provided, the generated image will be written to disk in output_dir. |
output_file |
VariationImageGenerationEngine
|
If provided, the generated image will be written to disk as output_file. |
Source code in griptape/tools/variation_image_generation_client/tool.py
engine: VariationImageGenerationEngine = field(kw_only=True)
class-attribute
instance-attribute
image_loader: ImageLoader = field(default=ImageLoader(), kw_only=True)
class-attribute
instance-attribute
image_variation_from_file(params)
Source code in griptape/tools/variation_image_generation_client/tool.py
image_variation_from_memory(params)
Source code in griptape/tools/variation_image_generation_client/tool.py
VectorStoreClient
Bases: BaseTool
Attributes:
Name | Type | Description |
---|---|---|
description |
str
|
LLM-friendly vector DB description. |
namespace |
Optional[str]
|
Vector storage namespace. |
query_engine |
VectorQueryEngine
|
|
top_n |
int
|
Max number of results returned for the query engine query. |
Source code in griptape/tools/vector_store_client/tool.py
DEFAULT_TOP_N = 5
class-attribute
instance-attribute
description: str = field(kw_only=True)
class-attribute
instance-attribute
namespace: Optional[str] = field(default=None, kw_only=True)
class-attribute
instance-attribute
query_engine: VectorQueryEngine = field(kw_only=True)
class-attribute
instance-attribute
top_n: int = field(default=DEFAULT_TOP_N, kw_only=True)
class-attribute
instance-attribute
search(params)
Source code in griptape/tools/vector_store_client/tool.py
WebScraper
Bases: BaseTool
Source code in griptape/tools/web_scraper/tool.py
web_loader: WebLoader = field(default=Factory(lambda: WebLoader()), kw_only=True)
class-attribute
instance-attribute
get_content(params)
Source code in griptape/tools/web_scraper/tool.py
WebSearch
Bases: BaseTool