From 0574f0d95c8801ea08dac65684e76090091d968c Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Tue, 13 Aug 2024 10:46:40 -0700 Subject: [PATCH] Rename all Tools for consistency --- CHANGELOG.md | 3 + README.md | 8 +- .../src/load_query_and_chat_marqo_1.py | 4 +- docs/examples/src/multi_agent_workflow_1.py | 12 +- .../src/multiple_agent_shared_memory_1.py | 6 +- docs/examples/src/query_webpage_astra_db_1.py | 6 +- docs/examples/src/talk_to_a_pdf_1.py | 6 +- docs/examples/src/talk_to_a_webpage_1.py | 6 +- docs/examples/src/talk_to_redshift_1.py | 6 +- docs/examples/talk-to-a-pdf.md | 2 +- docs/examples/talk-to-a-webpage.md | 2 +- .../src/audio_transcription_drivers_1.py | 4 +- .../drivers/src/embedding_drivers_10.py | 4 +- .../drivers/src/image_generation_drivers_1.py | 4 +- .../drivers/src/image_generation_drivers_2.py | 4 +- .../drivers/src/image_generation_drivers_3.py | 4 +- .../drivers/src/image_generation_drivers_4.py | 4 +- .../drivers/src/image_generation_drivers_5.py | 4 +- .../drivers/src/image_generation_drivers_6.py | 4 +- .../drivers/src/prompt_drivers_10.py | 4 +- .../drivers/src/text_to_speech_drivers_1.py | 4 +- .../drivers/src/text_to_speech_drivers_2.py | 4 +- .../drivers/src/web_scraper_drivers_3.py | 6 +- .../drivers/src/web_search_drivers_2.py | 6 +- .../drivers/structure-run-drivers.md | 2 +- docs/griptape-framework/index.md | 4 +- docs/griptape-framework/misc/src/events_3.py | 4 +- docs/griptape-framework/misc/src/events_4.py | 4 +- docs/griptape-framework/src/index_3.py | 4 +- docs/griptape-framework/src/index_4.py | 4 +- docs/griptape-framework/structures/agents.md | 2 +- .../structures/src/agents_1.py | 4 +- .../structures/src/task_memory_1.py | 6 +- .../structures/src/task_memory_2.py | 6 +- .../structures/src/task_memory_3.py | 6 +- .../structures/src/task_memory_4.py | 6 +- .../structures/src/task_memory_5.py | 6 +- .../structures/src/task_memory_6.py | 8 +- .../structures/src/task_memory_7.py | 4 +- .../structures/src/task_memory_8.py | 8 +- .../structures/src/task_memory_9.py | 4 +- .../structures/src/tasks_16.py | 12 +- .../structures/src/tasks_4.py | 4 +- .../structures/src/tasks_5.py | 4 +- .../structures/task-memory.md | 60 ++++----- docs/griptape-framework/structures/tasks.md | 4 +- docs/griptape-framework/tools/index.md | 2 +- docs/griptape-framework/tools/src/index_1.py | 4 +- ...-client.md => audio-transcription-tool.md} | 4 +- .../{aws-iam-client.md => aws-iam-tool.md} | 12 +- .../{aws-s3-client.md => aws-s3-tool.md} | 12 +- .../{calculator.md => calculator-tool.md} | 8 +- .../{computer.md => computer-tool.md} | 6 +- .../{date-time.md => date-time-tool.md} | 4 +- .../official-tools/email-client.md | 13 -- .../official-tools/email-tool.md | 13 ++ .../{file-manager.md => file-manager-tool.md} | 4 +- .../official-tools/google-cal-client.md | 8 -- .../official-tools/google-calendar-tool.md | 8 ++ ...gle-docs-client.md => google-docs-tool.md} | 10 +- ...e-drive-client.md => google-drive-tool.md} | 10 +- ...e-gmail-client.md => google-gmail-tool.md} | 10 +- .../griptape-cloud-knowledge-base-client.md | 9 -- .../griptape-cloud-knowledge-base-tool.md | 9 ++ ...ge-query-client.md => image-query-tool.md} | 4 +- ...md => inpainting-image-generation-tool.md} | 4 +- .../official-tools/openweather-client.md | 7 - .../official-tools/openweather-tool.md | 7 + ...d => outpainting-image-generation-tool.md} | 4 +- ...ent.md => prompt-image-generation-tool.md} | 4 +- .../{rag-client.md => rag-tool.md} | 8 +- .../{rest-api-client.md => rest-api-tool.md} | 6 +- .../{sql-client.md => sql-tool.md} | 12 +- ...ent_1.py => audio_transcription_tool_1.py} | 4 +- ...{aws_iam_client_1.py => aws_iam_tool_1.py} | 4 +- .../{aws_s3_client_1.py => aws_s3_tool_1.py} | 6 +- .../{calculator_1.py => calculator_tool_1.py} | 6 +- .../src/{computer_1.py => computer_tool_1.py} | 8 +- .../official-tools/src/date_time_1.py | 8 -- .../official-tools/src/date_time_tool_1.py | 8 ++ .../{email_client_1.py => email_tool_1.py} | 4 +- ...le_manager_1.py => file_manager_tool_1.py} | 6 +- ..._client_1.py => google_calendar_tool_1.py} | 10 +- ...docs_client_1.py => google_docs_tool_1.py} | 8 +- ...ive_client_1.py => google_drive_tool_1.py} | 8 +- ...ail_client_1.py => google_gmail_tool_1.py} | 8 +- ...> griptape_cloud_knowledge_base_tool_1.py} | 4 +- ...uery_client_1.py => image_query_tool_1.py} | 6 +- ... => inpainting_image_generation_tool_1.py} | 4 +- ...ther_client_1.py => openweather_tool_1.py} | 4 +- ...=> outpainting_image_generation_tool_1.py} | 4 +- ...1.py => prompt_image_generation_tool_1.py} | 4 +- .../src/{rag_client_1.py => rag_tool_1.py} | 6 +- ...est_api_client_1.py => rest_api_tool_1.py} | 4 +- .../src/{sql_client_1.py => sql_tool_1.py} | 4 +- ...un_client_1.py => structure_run_tool_1.py} | 6 +- .../src/task_memory_client_1.py | 4 - .../official-tools/src/task_memory_tool_1.py | 4 + ...h_client_1.py => text_to_speech_tool_1.py} | 4 +- ...y => variation_image_generation_tool_1.py} | 4 +- ...y => variation_image_generation_tool_2.py} | 6 +- ...ore_client_1.py => vector_store_tool_1.py} | 6 +- .../official-tools/src/web_scraper_1.py | 6 - .../official-tools/src/web_scraper_tool_1.py | 6 + .../{web_search_1.py => web_search_tool_1.py} | 8 +- .../{web_search_2.py => web_search_tool_2.py} | 4 +- ...re-run-client.md => structure-run-tool.md} | 10 +- ...k-memory-client.md => task-memory-tool.md} | 4 +- ...peech-client.md => text-to-speech-tool.md} | 4 +- ....md => variation-image-generation-tool.md} | 6 +- .../official-tools/vector-store-client.md | 7 - .../official-tools/vector-store-tool.md | 9 ++ .../{web-scraper.md => web-scraper-tool.md} | 6 +- .../{web-search.md => web-search-tool.md} | 6 +- griptape/tools/__init__.py | 124 +++++++++--------- .../__init__.py | 0 .../manifest.yml | 2 +- .../tool.py | 2 +- .../{aws_iam_client => aws_iam}/__init__.py | 0 .../{aws_iam_client => aws_iam}/manifest.yml | 2 +- .../tools/{aws_iam_client => aws_iam}/tool.py | 4 +- .../{aws_s3_client => aws_s3}/__init__.py | 0 .../{aws_s3_client => aws_s3}/manifest.yml | 2 +- .../tools/{aws_s3_client => aws_s3}/tool.py | 4 +- .../{base_aws_client.py => base_aws_tool.py} | 2 +- ...e_google_client.py => base_google_tool.py} | 2 +- ..._client.py => base_griptape_cloud_tool.py} | 2 +- ...lient.py => base_image_generation_tool.py} | 2 +- griptape/tools/calculator/manifest.yml | 4 +- griptape/tools/calculator/tool.py | 2 +- griptape/tools/computer/manifest.yml | 4 +- griptape/tools/computer/tool.py | 2 +- griptape/tools/date_time/manifest.yml | 4 +- griptape/tools/date_time/tool.py | 2 +- .../tools/{email_client => email}/__init__.py | 0 .../{email_client => email}/manifest.yml | 2 +- .../tools/{email_client => email}/tool.py | 2 +- griptape/tools/file_manager/manifest.yml | 4 +- griptape/tools/file_manager/tool.py | 4 +- .../__init__.py | 0 .../manifest.yml | 0 .../requirements.txt | 0 .../{google_cal => google_calendar}/tool.py | 4 +- griptape/tools/google_docs/tool.py | 4 +- griptape/tools/google_drive/tool.py | 4 +- griptape/tools/google_gmail/manifest.yml | 2 +- griptape/tools/google_gmail/tool.py | 4 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../tool.py | 6 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../tool.py | 2 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../requirements.txt | 0 .../tool.py | 12 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../tool.py | 2 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../requirements.txt | 0 .../tool.py | 12 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../requirements.txt | 0 .../tool.py | 8 +- .../tools/{rag_client => rag}/__init__.py | 0 .../tools/{rag_client => rag}/manifest.yml | 2 +- .../{rag_client => rag}/requirements.txt | 0 griptape/tools/{rag_client => rag}/tool.py | 2 +- .../{rest_api_client => rest_api}/__init__.py | 0 .../manifest.yml | 2 +- .../{rest_api_client => rest_api}/tool.py | 2 +- .../tools/{sql_client => sql}/__init__.py | 0 .../tools/{sql_client => sql}/manifest.yml | 2 +- griptape/tools/{sql_client => sql}/tool.py | 2 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../tool.py | 2 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../tool.py | 2 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../tool.py | 2 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../requirements.txt | 0 .../tool.py | 12 +- .../__init__.py | 0 .../manifest.yml | 2 +- .../requirements.txt | 0 .../tool.py | 2 +- griptape/tools/web_scraper/manifest.yml | 4 +- griptape/tools/web_scraper/tool.py | 2 +- griptape/tools/web_search/manifest.yml | 6 +- griptape/tools/web_search/tool.py | 2 +- mkdocs.yml | 56 ++++---- tests/integration/tasks/test_tool_task.py | 4 +- tests/integration/tasks/test_toolkit_task.py | 8 +- tests/integration/test_code_blocks.py | 2 +- ..._calculator.py => test_calculator_tool.py} | 4 +- ...e_manager.py => test_file_manager_tool.py} | 4 +- ...ocs_client.py => test_google_docs_tool.py} | 6 +- ...ve_client.py => test_google_drive_tool.py} | 6 +- .../{test_aws_iam.py => test_aws_iam_tool.py} | 12 +- .../{test_aws_s3.py => test_aws_s3_tool.py} | 25 ++-- tests/unit/tools/test_calculator.py | 4 +- tests/unit/tools/test_computer.py | 4 +- tests/unit/tools/test_date_time.py | 12 +- ...est_email_client.py => test_email_tool.py} | 12 +- tests/unit/tools/test_file_manager.py | 22 ++-- ...ocs_client.py => test_google_docs_tool.py} | 6 +- ...ve_client.py => test_google_drive_tool.py} | 18 +-- ...il_client.py => test_google_gmail_tool.py} | 6 +- ...est_griptape_cloud_knowledge_base_tool.py} | 20 +-- ... test_inpainting_image_generation_tool.py} | 14 +- ...her_client.py => test_openweather_tool.py} | 8 +- ... test_outpainting_image_variation_tool.py} | 14 +- ...y => test_prompt_image_generation_tool.py} | 12 +- .../{test_rag_client.py => test_rag_tool.py} | 6 +- ...st_api_client.py => test_rest_api_tool.py} | 4 +- .../{test_sql_client.py => test_sql_tool.py} | 8 +- ...n_client.py => test_structure_run_tool.py} | 6 +- ...ory_client.py => test_task_memory_tool.py} | 6 +- ..._client.py => test_text_to_speech_tool.py} | 12 +- ...n_client.py => test_transcription_tool.py} | 10 +- ...> test_variation_image_generation_tool.py} | 14 +- ...re_client.py => test_vector_store_tool.py} | 12 +- tests/unit/tools/test_web_scraper.py | 4 +- tests/unit/tools/test_web_search.py | 6 +- 233 files changed, 700 insertions(+), 696 deletions(-) rename docs/griptape-tools/official-tools/{audio-transcription-client.md => audio-transcription-tool.md} (90%) rename docs/griptape-tools/official-tools/{aws-iam-client.md => aws-iam-tool.md} (89%) rename docs/griptape-tools/official-tools/{aws-s3-client.md => aws-s3-tool.md} (90%) rename docs/griptape-tools/official-tools/{calculator.md => calculator-tool.md} (82%) rename docs/griptape-tools/official-tools/{computer.md => computer-tool.md} (97%) rename docs/griptape-tools/official-tools/{date-time.md => date-time-tool.md} (93%) delete mode 100644 docs/griptape-tools/official-tools/email-client.md create mode 100644 docs/griptape-tools/official-tools/email-tool.md rename docs/griptape-tools/official-tools/{file-manager.md => file-manager-tool.md} (94%) delete mode 100644 docs/griptape-tools/official-tools/google-cal-client.md create mode 100644 docs/griptape-tools/official-tools/google-calendar-tool.md rename docs/griptape-tools/official-tools/{google-docs-client.md => google-docs-tool.md} (79%) rename docs/griptape-tools/official-tools/{google-drive-client.md => google-drive-tool.md} (77%) rename docs/griptape-tools/official-tools/{google-gmail-client.md => google-gmail-tool.md} (78%) delete mode 100644 docs/griptape-tools/official-tools/griptape-cloud-knowledge-base-client.md create mode 100644 docs/griptape-tools/official-tools/griptape-cloud-knowledge-base-tool.md rename docs/griptape-tools/official-tools/{image-query-client.md => image-query-tool.md} (58%) rename docs/griptape-tools/official-tools/{inpainting-image-generation-client.md => inpainting-image-generation-tool.md} (87%) delete mode 100644 docs/griptape-tools/official-tools/openweather-client.md create mode 100644 docs/griptape-tools/official-tools/openweather-tool.md rename docs/griptape-tools/official-tools/{outpainting-image-generation-client.md => outpainting-image-generation-tool.md} (86%) rename docs/griptape-tools/official-tools/{prompt-image-generation-client.md => prompt-image-generation-tool.md} (73%) rename docs/griptape-tools/official-tools/{rag-client.md => rag-tool.md} (86%) rename docs/griptape-tools/official-tools/{rest-api-client.md => rest-api-tool.md} (50%) rename docs/griptape-tools/official-tools/{sql-client.md => sql-tool.md} (90%) rename docs/griptape-tools/official-tools/src/{audio_transcription_client_1.py => audio_transcription_tool_1.py} (79%) rename docs/griptape-tools/official-tools/src/{aws_iam_client_1.py => aws_iam_tool_1.py} (72%) rename docs/griptape-tools/official-tools/src/{aws_s3_client_1.py => aws_s3_tool_1.py} (50%) rename docs/griptape-tools/official-tools/src/{calculator_1.py => calculator_tool_1.py} (56%) rename docs/griptape-tools/official-tools/src/{computer_1.py => computer_tool_1.py} (77%) delete mode 100644 docs/griptape-tools/official-tools/src/date_time_1.py create mode 100644 docs/griptape-tools/official-tools/src/date_time_tool_1.py rename docs/griptape-tools/official-tools/src/{email_client_1.py => email_tool_1.py} (79%) rename docs/griptape-tools/official-tools/src/{file_manager_1.py => file_manager_tool_1.py} (73%) rename docs/griptape-tools/official-tools/src/{google_cal_client_1.py => google_calendar_tool_1.py} (79%) rename docs/griptape-tools/official-tools/src/{google_docs_client_1.py => google_docs_tool_1.py} (85%) rename docs/griptape-tools/official-tools/src/{google_drive_client_1.py => google_drive_tool_1.py} (84%) rename docs/griptape-tools/official-tools/src/{google_gmail_client_1.py => google_gmail_tool_1.py} (85%) rename docs/griptape-tools/official-tools/src/{griptape_cloud_knowledge_base_client_1.py => griptape_cloud_knowledge_base_tool_1.py} (75%) rename docs/griptape-tools/official-tools/src/{image_query_client_1.py => image_query_tool_1.py} (80%) rename docs/griptape-tools/official-tools/src/{inpainting_image_generation_client_1.py => inpainting_image_generation_tool_1.py} (90%) rename docs/griptape-tools/official-tools/src/{openweather_client_1.py => openweather_tool_1.py} (75%) rename docs/griptape-tools/official-tools/src/{outpainting_image_generation_client_1.py => outpainting_image_generation_tool_1.py} (89%) rename docs/griptape-tools/official-tools/src/{prompt_image_generation_client_1.py => prompt_image_generation_tool_1.py} (89%) rename docs/griptape-tools/official-tools/src/{rag_client_1.py => rag_tool_1.py} (93%) rename docs/griptape-tools/official-tools/src/{rest_api_client_1.py => rest_api_tool_1.py} (98%) rename docs/griptape-tools/official-tools/src/{sql_client_1.py => sql_tool_1.py} (91%) rename docs/griptape-tools/official-tools/src/{structure_run_client_1.py => structure_run_tool_1.py} (83%) delete mode 100644 docs/griptape-tools/official-tools/src/task_memory_client_1.py create mode 100644 docs/griptape-tools/official-tools/src/task_memory_tool_1.py rename docs/griptape-tools/official-tools/src/{text_to_speech_client_1.py => text_to_speech_tool_1.py} (81%) rename docs/griptape-tools/official-tools/src/{variation_image_generation_client_1.py => variation_image_generation_tool_1.py} (90%) rename docs/griptape-tools/official-tools/src/{variation_image_generation_client_2.py => variation_image_generation_tool_2.py} (89%) rename docs/griptape-tools/official-tools/src/{vector_store_client_1.py => vector_store_tool_1.py} (81%) delete mode 100644 docs/griptape-tools/official-tools/src/web_scraper_1.py create mode 100644 docs/griptape-tools/official-tools/src/web_scraper_tool_1.py rename docs/griptape-tools/official-tools/src/{web_search_1.py => web_search_tool_1.py} (71%) rename docs/griptape-tools/official-tools/src/{web_search_2.py => web_search_tool_2.py} (91%) rename docs/griptape-tools/official-tools/{structure-run-client.md => structure-run-tool.md} (90%) rename docs/griptape-tools/official-tools/{task-memory-client.md => task-memory-tool.md} (74%) rename docs/griptape-tools/official-tools/{text-to-speech-client.md => text-to-speech-tool.md} (72%) rename docs/griptape-tools/official-tools/{variation-image-generation-client.md => variation-image-generation-tool.md} (83%) delete mode 100644 docs/griptape-tools/official-tools/vector-store-client.md create mode 100644 docs/griptape-tools/official-tools/vector-store-tool.md rename docs/griptape-tools/official-tools/{web-scraper.md => web-scraper-tool.md} (96%) rename docs/griptape-tools/official-tools/{web-search.md => web-search-tool.md} (97%) rename griptape/tools/{audio_transcription_client => audio_transcription}/__init__.py (100%) rename griptape/tools/{audio_transcription_client => audio_transcription}/manifest.yml (84%) rename griptape/tools/{audio_transcription_client => audio_transcription}/tool.py (98%) rename griptape/tools/{aws_iam_client => aws_iam}/__init__.py (100%) rename griptape/tools/{aws_iam_client => aws_iam}/manifest.yml (86%) rename griptape/tools/{aws_iam_client => aws_iam}/tool.py (97%) rename griptape/tools/{aws_s3_client => aws_s3}/__init__.py (100%) rename griptape/tools/{aws_s3_client => aws_s3}/manifest.yml (86%) rename griptape/tools/{aws_s3_client => aws_s3}/tool.py (99%) rename griptape/tools/{base_aws_client.py => base_aws_tool.py} (95%) rename griptape/tools/{base_google_client.py => base_google_tool.py} (98%) rename griptape/tools/{base_griptape_cloud_client.py => base_griptape_cloud_tool.py} (93%) rename griptape/tools/{base_image_generation_client.py => base_image_generation_tool.py} (88%) rename griptape/tools/{email_client => email}/__init__.py (100%) rename griptape/tools/{email_client => email}/manifest.yml (87%) rename griptape/tools/{email_client => email}/tool.py (99%) rename griptape/tools/{google_cal => google_calendar}/__init__.py (100%) rename griptape/tools/{google_cal => google_calendar}/manifest.yml (100%) rename griptape/tools/{google_cal => google_calendar}/requirements.txt (100%) rename griptape/tools/{google_cal => google_calendar}/tool.py (98%) rename griptape/tools/{griptape_cloud_knowledge_base_client => griptape_cloud_knowledge_base}/__init__.py (100%) rename griptape/tools/{griptape_cloud_knowledge_base_client => griptape_cloud_knowledge_base}/manifest.yml (78%) rename griptape/tools/{griptape_cloud_knowledge_base_client => griptape_cloud_knowledge_base}/tool.py (91%) rename griptape/tools/{image_query_client => image_query}/__init__.py (100%) rename griptape/tools/{image_query_client => image_query}/manifest.yml (86%) rename griptape/tools/{image_query_client => image_query}/tool.py (99%) rename griptape/tools/{inpainting_image_generation_client => inpainting_image_generation}/__init__.py (100%) rename griptape/tools/{inpainting_image_generation_client => inpainting_image_generation}/manifest.yml (79%) rename griptape/tools/{inpainting_image_generation_client => inpainting_image_generation}/requirements.txt (100%) rename griptape/tools/{inpainting_image_generation_client => inpainting_image_generation}/tool.py (93%) rename griptape/tools/{openweather_client => openweather}/__init__.py (100%) rename griptape/tools/{openweather_client => openweather}/manifest.yml (86%) rename griptape/tools/{openweather_client => openweather}/tool.py (99%) rename griptape/tools/{outpainting_image_generation_client => outpainting_image_generation}/__init__.py (100%) rename griptape/tools/{outpainting_image_generation_client => outpainting_image_generation}/manifest.yml (79%) rename griptape/tools/{outpainting_image_generation_client => outpainting_image_generation}/requirements.txt (100%) rename griptape/tools/{outpainting_image_generation_client => outpainting_image_generation}/tool.py (93%) rename griptape/tools/{prompt_image_generation_client => prompt_image_generation}/__init__.py (100%) rename griptape/tools/{prompt_image_generation_client => prompt_image_generation}/manifest.yml (80%) rename griptape/tools/{prompt_image_generation_client => prompt_image_generation}/requirements.txt (100%) rename griptape/tools/{prompt_image_generation_client => prompt_image_generation}/tool.py (87%) rename griptape/tools/{rag_client => rag}/__init__.py (100%) rename griptape/tools/{rag_client => rag}/manifest.yml (88%) rename griptape/tools/{rag_client => rag}/requirements.txt (100%) rename griptape/tools/{rag_client => rag}/tool.py (97%) rename griptape/tools/{rest_api_client => rest_api}/__init__.py (100%) rename griptape/tools/{rest_api_client => rest_api}/manifest.yml (87%) rename griptape/tools/{rest_api_client => rest_api}/tool.py (99%) rename griptape/tools/{sql_client => sql}/__init__.py (100%) rename griptape/tools/{sql_client => sql}/manifest.yml (88%) rename griptape/tools/{sql_client => sql}/tool.py (98%) rename griptape/tools/{structure_run_client => structure_run}/__init__.py (100%) rename griptape/tools/{structure_run_client => structure_run}/manifest.yml (83%) rename griptape/tools/{structure_run_client => structure_run}/tool.py (97%) rename griptape/tools/{task_memory_client => task_memory}/__init__.py (100%) rename griptape/tools/{task_memory_client => task_memory}/manifest.yml (85%) rename griptape/tools/{task_memory_client => task_memory}/tool.py (98%) rename griptape/tools/{text_to_speech_client => text_to_speech}/__init__.py (100%) rename griptape/tools/{text_to_speech_client => text_to_speech}/manifest.yml (83%) rename griptape/tools/{text_to_speech_client => text_to_speech}/tool.py (95%) rename griptape/tools/{variation_image_generation_client => variation_image_generation}/__init__.py (100%) rename griptape/tools/{variation_image_generation_client => variation_image_generation}/manifest.yml (79%) rename griptape/tools/{variation_image_generation_client => variation_image_generation}/requirements.txt (100%) rename griptape/tools/{variation_image_generation_client => variation_image_generation}/tool.py (91%) rename griptape/tools/{vector_store_client => vector_store}/__init__.py (100%) rename griptape/tools/{vector_store_client => vector_store}/manifest.yml (85%) rename griptape/tools/{vector_store_client => vector_store}/requirements.txt (100%) rename griptape/tools/{vector_store_client => vector_store}/tool.py (98%) rename tests/integration/tools/{test_calculator.py => test_calculator_tool.py} (73%) rename tests/integration/tools/{test_file_manager.py => test_file_manager_tool.py} (79%) rename tests/integration/tools/{test_google_docs_client.py => test_google_docs_tool.py} (95%) rename tests/integration/tools/{test_google_drive_client.py => test_google_drive_tool.py} (94%) rename tests/unit/tools/{test_aws_iam.py => test_aws_iam_tool.py} (56%) rename tests/unit/tools/{test_aws_s3.py => test_aws_s3_tool.py} (58%) rename tests/unit/tools/{test_email_client.py => test_email_tool.py} (93%) rename tests/unit/tools/{test_google_docs_client.py => test_google_docs_tool.py} (84%) rename tests/unit/tools/{test_google_drive_client.py => test_google_drive_tool.py} (68%) rename tests/unit/tools/{test_google_gmail_client.py => test_google_gmail_tool.py} (61%) rename tests/unit/tools/{test_griptape_cloud_knowledge_base_client.py => test_griptape_cloud_knowledge_base_tool.py} (83%) rename tests/unit/tools/{test_inpainting_image_generation_client.py => test_inpainting_image_generation_tool.py} (87%) rename tests/unit/tools/{test_openweather_client.py => test_openweather_tool.py} (92%) rename tests/unit/tools/{test_outpainting_image_variation_client.py => test_outpainting_image_variation_tool.py} (87%) rename tests/unit/tools/{test_prompt_image_generation_client.py => test_prompt_image_generation_tool.py} (77%) rename tests/unit/tools/{test_rag_client.py => test_rag_tool.py} (72%) rename tests/unit/tools/{test_rest_api_client.py => test_rest_api_tool.py} (92%) rename tests/unit/tools/{test_sql_client.py => test_sql_tool.py} (87%) rename tests/unit/tools/{test_structure_run_client.py => test_structure_run_tool.py} (82%) rename tests/unit/tools/{test_task_memory_client.py => test_task_memory_tool.py} (80%) rename tests/unit/tools/{test_text_to_speech_client.py => test_text_to_speech_tool.py} (74%) rename tests/unit/tools/{test_transcription_client.py => test_transcription_tool.py} (83%) rename tests/unit/tools/{test_variation_image_generation_client.py => test_variation_image_generation_tool.py} (88%) rename tests/unit/tools/{test_vector_store_client.py => test_vector_store_tool.py} (78%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b7b08f36..ef91010ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING**: `RagContext.output` was changed to `RagContext.outputs` to support multiple outputs. All relevant RAG modules were adjusted accordingly. - **BREAKING**: Removed before and after response modules from `ResponseRagStage`. - **BREAKING**: Moved ruleset and metadata ingestion from standalone modules to `PromptResponseRagModule`. +- **BREAKING**: Dropped `Client` from all Tool names for better naming consistency. +- **BREAKING**: Dropped `_client` suffix from all Tool packages. +- **BREAKING**: Added `Tool` suffix to all Tool names for better naming consistency. - Engines that previously required Drivers now pull from `griptape.config.config.drivers` by default. - `BaseTask.add_parent/child` will now call `self.structure.add_task` if possible. diff --git a/README.md b/README.md index 42df8fbd6..1f6d6d883 100644 --- a/README.md +++ b/README.md @@ -89,14 +89,14 @@ With Griptape, you can create Structures, such as Agents, Pipelines, and Workflo ```python from griptape.structures import Agent -from griptape.tools import WebScraper, FileManager, TaskMemoryClient +from griptape.tools import WebScraperTool, FileManagerTool, TaskMemoryTool agent = Agent( input="Load {{ args[0] }}, summarize it, and store it in a file called {{ args[1] }}.", tools=[ - WebScraper(off_prompt=True), - TaskMemoryClient(off_prompt=True), - FileManager() + WebScraperTool(off_prompt=True), + TaskMemoryTool(off_prompt=True), + FileManagerTool() ] ) agent.run("https://griptape.ai", "griptape.txt") diff --git a/docs/examples/src/load_query_and_chat_marqo_1.py b/docs/examples/src/load_query_and_chat_marqo_1.py index ac3ffca0d..013a0264f 100644 --- a/docs/examples/src/load_query_and_chat_marqo_1.py +++ b/docs/examples/src/load_query_and_chat_marqo_1.py @@ -5,7 +5,7 @@ from griptape.drivers import MarqoVectorStoreDriver, OpenAiEmbeddingDriver from griptape.loaders import WebLoader from griptape.structures import Agent -from griptape.tools import VectorStoreClient +from griptape.tools import VectorStoreTool # Define the namespace namespace = "griptape-ai" @@ -19,7 +19,7 @@ ) # Initialize the knowledge base tool -vector_store_tool = VectorStoreClient( +vector_store_tool = VectorStoreTool( description="Contains information about the Griptape Framework from www.griptape.ai", vector_store_driver=vector_store, ) diff --git a/docs/examples/src/multi_agent_workflow_1.py b/docs/examples/src/multi_agent_workflow_1.py index 311fa22a2..137a5075f 100644 --- a/docs/examples/src/multi_agent_workflow_1.py +++ b/docs/examples/src/multi_agent_workflow_1.py @@ -5,9 +5,9 @@ from griptape.structures import Agent, Workflow from griptape.tasks import PromptTask, StructureRunTask from griptape.tools import ( - TaskMemoryClient, - WebScraper, - WebSearch, + TaskMemoryTool, + WebScraperTool, + WebSearchTool, ) WRITERS = [ @@ -29,16 +29,16 @@ def build_researcher() -> Agent: researcher = Agent( id="researcher", tools=[ - WebSearch( + WebSearchTool( web_search_driver=GoogleWebSearchDriver( api_key=os.environ["GOOGLE_API_KEY"], search_id=os.environ["GOOGLE_API_SEARCH_ID"], ), ), - WebScraper( + WebScraperTool( off_prompt=True, ), - TaskMemoryClient(off_prompt=False), + TaskMemoryTool(off_prompt=False), ], rulesets=[ Ruleset( diff --git a/docs/examples/src/multiple_agent_shared_memory_1.py b/docs/examples/src/multiple_agent_shared_memory_1.py index 118684d37..e156e531a 100644 --- a/docs/examples/src/multiple_agent_shared_memory_1.py +++ b/docs/examples/src/multiple_agent_shared_memory_1.py @@ -3,7 +3,7 @@ from griptape.config import AzureOpenAiDriverConfig, config from griptape.drivers import AzureMongoDbVectorStoreDriver, AzureOpenAiEmbeddingDriver from griptape.structures import Agent -from griptape.tools import TaskMemoryClient, WebScraper +from griptape.tools import TaskMemoryTool, WebScraperTool AZURE_OPENAI_ENDPOINT_1 = os.environ["AZURE_OPENAI_ENDPOINT_1"] AZURE_OPENAI_API_KEY_1 = os.environ["AZURE_OPENAI_API_KEY_1"] @@ -41,12 +41,12 @@ loader = Agent( tools=[ - WebScraper(off_prompt=True), + WebScraperTool(off_prompt=True), ], ) asker = Agent( tools=[ - TaskMemoryClient(off_prompt=False), + TaskMemoryTool(off_prompt=False), ], meta_memory=loader.meta_memory, task_memory=loader.task_memory, diff --git a/docs/examples/src/query_webpage_astra_db_1.py b/docs/examples/src/query_webpage_astra_db_1.py index b5d2b0a01..6a96a813e 100644 --- a/docs/examples/src/query_webpage_astra_db_1.py +++ b/docs/examples/src/query_webpage_astra_db_1.py @@ -14,7 +14,7 @@ from griptape.engines.rag.stages import ResponseRagStage, RetrievalRagStage from griptape.loaders import WebLoader from griptape.structures import Agent -from griptape.tools import RagClient, TaskMemoryClient +from griptape.tools import RagTool, TaskMemoryTool namespace = "datastax_blog" input_blogpost = "www.datastax.com/blog/indexing-all-of-wikipedia-on-a-laptop" @@ -49,9 +49,9 @@ raise Exception(artifacts.value) vector_store_driver.upsert_text_artifacts({namespace: artifacts}) -vector_store_tool = RagClient( +rag_tool = RagTool( description="A DataStax blog post", rag_engine=engine, ) -agent = Agent(tools=[vector_store_tool, TaskMemoryClient(off_prompt=False)]) +agent = Agent(tools=[rag_tool, TaskMemoryTool(off_prompt=False)]) agent.run("What engine made possible to index such an amount of data, " "and what kind of tuning was required?") diff --git a/docs/examples/src/talk_to_a_pdf_1.py b/docs/examples/src/talk_to_a_pdf_1.py index 2ac184a22..b4ab72029 100644 --- a/docs/examples/src/talk_to_a_pdf_1.py +++ b/docs/examples/src/talk_to_a_pdf_1.py @@ -7,7 +7,7 @@ from griptape.engines.rag.stages import ResponseRagStage, RetrievalRagStage from griptape.loaders import PdfLoader from griptape.structures import Agent -from griptape.tools import RagClient +from griptape.tools import RagTool from griptape.utils import Chat namespace = "attention" @@ -25,7 +25,7 @@ response_modules=[PromptResponseRagModule(prompt_driver=OpenAiChatPromptDriver(model="gpt-4o"))] ), ) -vector_store_tool = RagClient( +rag_tool = RagTool( description="Contains information about the Attention Is All You Need paper. " "Use it to answer any related questions.", rag_engine=engine, @@ -37,6 +37,6 @@ vector_store.upsert_text_artifacts({namespace: artifacts}) -agent = Agent(tools=[vector_store_tool]) +agent = Agent(tools=[rag_tool]) Chat(agent).start() diff --git a/docs/examples/src/talk_to_a_webpage_1.py b/docs/examples/src/talk_to_a_webpage_1.py index d24eb9427..0412ed977 100644 --- a/docs/examples/src/talk_to_a_webpage_1.py +++ b/docs/examples/src/talk_to_a_webpage_1.py @@ -6,7 +6,7 @@ from griptape.loaders import WebLoader from griptape.rules import Rule, Ruleset from griptape.structures import Agent -from griptape.tools import RagClient +from griptape.tools import RagTool from griptape.utils import Chat namespace = "physics-wiki" @@ -33,7 +33,7 @@ vector_store_driver.upsert_text_artifacts({namespace: artifacts}) -vector_store_tool = RagClient( +rag_tool = RagTool( description="Contains information about physics. " "Use it to answer any physics-related questions.", rag_engine=engine, ) @@ -45,7 +45,7 @@ rules=[Rule("Always introduce yourself as a physics tutor"), Rule("Be truthful. Only discuss physics.")], ) ], - tools=[vector_store_tool], + tools=[rag_tool], ) Chat(agent).start() diff --git a/docs/examples/src/talk_to_redshift_1.py b/docs/examples/src/talk_to_redshift_1.py index 7354a77cc..bd4b57f4f 100644 --- a/docs/examples/src/talk_to_redshift_1.py +++ b/docs/examples/src/talk_to_redshift_1.py @@ -6,7 +6,7 @@ from griptape.loaders import SqlLoader from griptape.rules import Rule, Ruleset from griptape.structures import Agent -from griptape.tools import FileManager, SqlClient +from griptape.tools import FileManagerTool, SqlTool from griptape.utils import Chat session = boto3.Session() @@ -19,7 +19,7 @@ ) ) -sql_tool = SqlClient( +sql_tool = SqlTool( sql_loader=sql_loader, table_name="people", table_description="contains information about tech industry professionals", @@ -27,7 +27,7 @@ ) agent = Agent( - tools=[sql_tool, FileManager()], + tools=[sql_tool, FileManagerTool()], rulesets=[ Ruleset( name="HumansOrg Agent", diff --git a/docs/examples/talk-to-a-pdf.md b/docs/examples/talk-to-a-pdf.md index 2e0743ae4..0524359d5 100644 --- a/docs/examples/talk-to-a-pdf.md +++ b/docs/examples/talk-to-a-pdf.md @@ -1,4 +1,4 @@ -This example demonstrates how to vectorize a PDF of the [Attention Is All You Need](https://arxiv.org/pdf/1706.03762.pdf) paper and setup a Griptape agent with rules and the [VectorStoreClient](../reference/griptape/tools/vector_store_client/tool.md) tool to use it during conversations. +This example demonstrates how to vectorize a PDF of the [Attention Is All You Need](https://arxiv.org/pdf/1706.03762.pdf) paper and setup a Griptape agent with rules and the [VectorStoreTool](../reference/griptape/tools/vector_store/tool.md) tool to use it during conversations. ```python --8<-- "docs/examples/src/talk_to_a_pdf_1.py" diff --git a/docs/examples/talk-to-a-webpage.md b/docs/examples/talk-to-a-webpage.md index 2bee2c9ba..e4632d401 100644 --- a/docs/examples/talk-to-a-webpage.md +++ b/docs/examples/talk-to-a-webpage.md @@ -1,4 +1,4 @@ -This example demonstrates how to vectorize a webpage and setup a Griptape agent with rules and the [RagClient](../reference/griptape/tools/rag_client/tool.md) tool to use it during conversations. +This example demonstrates how to vectorize a webpage and setup a Griptape agent with rules and the [RagClient](../reference/griptape/tools/rag/tool.md) tool to use it during conversations. ```python --8<-- "docs/examples/src/talk_to_a_webpage_1.py" diff --git a/docs/griptape-framework/drivers/src/audio_transcription_drivers_1.py b/docs/griptape-framework/drivers/src/audio_transcription_drivers_1.py index e4415e1d4..16013638e 100644 --- a/docs/griptape-framework/drivers/src/audio_transcription_drivers_1.py +++ b/docs/griptape-framework/drivers/src/audio_transcription_drivers_1.py @@ -1,11 +1,11 @@ from griptape.drivers import OpenAiAudioTranscriptionDriver from griptape.engines import AudioTranscriptionEngine from griptape.structures import Agent -from griptape.tools.audio_transcription_client.tool import AudioTranscriptionClient +from griptape.tools.audio_transcription.tool import AudioTranscriptionTool driver = OpenAiAudioTranscriptionDriver(model="whisper-1") -tool = AudioTranscriptionClient( +tool = AudioTranscriptionTool( off_prompt=False, engine=AudioTranscriptionEngine( audio_transcription_driver=driver, diff --git a/docs/griptape-framework/drivers/src/embedding_drivers_10.py b/docs/griptape-framework/drivers/src/embedding_drivers_10.py index 3ef816b29..4f7560c99 100644 --- a/docs/griptape-framework/drivers/src/embedding_drivers_10.py +++ b/docs/griptape-framework/drivers/src/embedding_drivers_10.py @@ -4,7 +4,7 @@ VoyageAiEmbeddingDriver, ) from griptape.structures import Agent -from griptape.tools import TaskMemoryClient, WebScraper +from griptape.tools import TaskMemoryTool, WebScraperTool config.drivers = DriverConfig( prompt=OpenAiChatPromptDriver(model="gpt-4o"), @@ -12,7 +12,7 @@ ) agent = Agent( - tools=[WebScraper(off_prompt=True), TaskMemoryClient(off_prompt=False)], + tools=[WebScraperTool(off_prompt=True), TaskMemoryTool(off_prompt=False)], ) agent.run("based on https://www.griptape.ai/, tell me what Griptape is") diff --git a/docs/griptape-framework/drivers/src/image_generation_drivers_1.py b/docs/griptape-framework/drivers/src/image_generation_drivers_1.py index 637b6ec7a..b20a42265 100644 --- a/docs/griptape-framework/drivers/src/image_generation_drivers_1.py +++ b/docs/griptape-framework/drivers/src/image_generation_drivers_1.py @@ -1,7 +1,7 @@ from griptape.drivers import OpenAiImageGenerationDriver from griptape.engines import PromptImageGenerationEngine from griptape.structures import Agent -from griptape.tools import PromptImageGenerationClient +from griptape.tools import PromptImageGenerationTool driver = OpenAiImageGenerationDriver( model="dall-e-2", @@ -11,7 +11,7 @@ agent = Agent( tools=[ - PromptImageGenerationClient(engine=engine), + PromptImageGenerationTool(engine=engine), ] ) diff --git a/docs/griptape-framework/drivers/src/image_generation_drivers_2.py b/docs/griptape-framework/drivers/src/image_generation_drivers_2.py index 63663ae79..ab07fcb27 100644 --- a/docs/griptape-framework/drivers/src/image_generation_drivers_2.py +++ b/docs/griptape-framework/drivers/src/image_generation_drivers_2.py @@ -1,7 +1,7 @@ from griptape.drivers import AmazonBedrockImageGenerationDriver, BedrockStableDiffusionImageGenerationModelDriver from griptape.engines import PromptImageGenerationEngine from griptape.structures import Agent -from griptape.tools import PromptImageGenerationClient +from griptape.tools import PromptImageGenerationTool model_driver = BedrockStableDiffusionImageGenerationModelDriver( style_preset="pixel-art", @@ -16,7 +16,7 @@ agent = Agent( tools=[ - PromptImageGenerationClient(engine=engine), + PromptImageGenerationTool(engine=engine), ] ) diff --git a/docs/griptape-framework/drivers/src/image_generation_drivers_3.py b/docs/griptape-framework/drivers/src/image_generation_drivers_3.py index 630d80f20..b8c63589d 100644 --- a/docs/griptape-framework/drivers/src/image_generation_drivers_3.py +++ b/docs/griptape-framework/drivers/src/image_generation_drivers_3.py @@ -1,7 +1,7 @@ from griptape.drivers import AmazonBedrockImageGenerationDriver, BedrockTitanImageGenerationModelDriver from griptape.engines import PromptImageGenerationEngine from griptape.structures import Agent -from griptape.tools import PromptImageGenerationClient +from griptape.tools import PromptImageGenerationTool model_driver = BedrockTitanImageGenerationModelDriver() @@ -14,7 +14,7 @@ agent = Agent( tools=[ - PromptImageGenerationClient(engine=engine), + PromptImageGenerationTool(engine=engine), ] ) diff --git a/docs/griptape-framework/drivers/src/image_generation_drivers_4.py b/docs/griptape-framework/drivers/src/image_generation_drivers_4.py index 428f470cf..f1bc06200 100644 --- a/docs/griptape-framework/drivers/src/image_generation_drivers_4.py +++ b/docs/griptape-framework/drivers/src/image_generation_drivers_4.py @@ -3,7 +3,7 @@ from griptape.drivers import AzureOpenAiImageGenerationDriver from griptape.engines import PromptImageGenerationEngine from griptape.structures import Agent -from griptape.tools import PromptImageGenerationClient +from griptape.tools import PromptImageGenerationTool driver = AzureOpenAiImageGenerationDriver( model="dall-e-3", @@ -16,7 +16,7 @@ agent = Agent( tools=[ - PromptImageGenerationClient(engine=engine), + PromptImageGenerationTool(engine=engine), ] ) diff --git a/docs/griptape-framework/drivers/src/image_generation_drivers_5.py b/docs/griptape-framework/drivers/src/image_generation_drivers_5.py index 06157107f..46173a232 100644 --- a/docs/griptape-framework/drivers/src/image_generation_drivers_5.py +++ b/docs/griptape-framework/drivers/src/image_generation_drivers_5.py @@ -3,7 +3,7 @@ from griptape.drivers import LeonardoImageGenerationDriver from griptape.engines import PromptImageGenerationEngine from griptape.structures import Agent -from griptape.tools import PromptImageGenerationClient +from griptape.tools import PromptImageGenerationTool driver = LeonardoImageGenerationDriver( model=os.environ["LEONARDO_MODEL_ID"], @@ -16,7 +16,7 @@ agent = Agent( tools=[ - PromptImageGenerationClient(engine=engine), + PromptImageGenerationTool(engine=engine), ] ) diff --git a/docs/griptape-framework/drivers/src/image_generation_drivers_6.py b/docs/griptape-framework/drivers/src/image_generation_drivers_6.py index feb8a54d7..d295da4ff 100644 --- a/docs/griptape-framework/drivers/src/image_generation_drivers_6.py +++ b/docs/griptape-framework/drivers/src/image_generation_drivers_6.py @@ -1,7 +1,7 @@ from griptape.drivers import OpenAiImageGenerationDriver from griptape.engines import PromptImageGenerationEngine from griptape.structures import Agent -from griptape.tools import PromptImageGenerationClient +from griptape.tools import PromptImageGenerationTool driver = OpenAiImageGenerationDriver( model="dall-e-2", @@ -12,7 +12,7 @@ agent = Agent( tools=[ - PromptImageGenerationClient(engine=engine), + PromptImageGenerationTool(engine=engine), ] ) diff --git a/docs/griptape-framework/drivers/src/prompt_drivers_10.py b/docs/griptape-framework/drivers/src/prompt_drivers_10.py index 04e2acb35..1d757668c 100644 --- a/docs/griptape-framework/drivers/src/prompt_drivers_10.py +++ b/docs/griptape-framework/drivers/src/prompt_drivers_10.py @@ -1,11 +1,11 @@ from griptape.drivers import OllamaPromptDriver from griptape.structures import Agent -from griptape.tools import Calculator +from griptape.tools import CalculatorTool agent = Agent( prompt_driver=OllamaPromptDriver( model="llama3.1", ), - tools=[Calculator()], + tools=[CalculatorTool()], ) agent.run("What is (192 + 12) ^ 4") diff --git a/docs/griptape-framework/drivers/src/text_to_speech_drivers_1.py b/docs/griptape-framework/drivers/src/text_to_speech_drivers_1.py index c6a03b80d..376113d63 100644 --- a/docs/griptape-framework/drivers/src/text_to_speech_drivers_1.py +++ b/docs/griptape-framework/drivers/src/text_to_speech_drivers_1.py @@ -3,7 +3,7 @@ from griptape.drivers import ElevenLabsTextToSpeechDriver from griptape.engines import TextToSpeechEngine from griptape.structures import Agent -from griptape.tools.text_to_speech_client.tool import TextToSpeechClient +from griptape.tools.text_to_speech.tool import TextToSpeechTool driver = ElevenLabsTextToSpeechDriver( api_key=os.environ["ELEVEN_LABS_API_KEY"], @@ -11,7 +11,7 @@ voice="Matilda", ) -tool = TextToSpeechClient( +tool = TextToSpeechTool( engine=TextToSpeechEngine( text_to_speech_driver=driver, ), diff --git a/docs/griptape-framework/drivers/src/text_to_speech_drivers_2.py b/docs/griptape-framework/drivers/src/text_to_speech_drivers_2.py index 99927a390..4a6323b1b 100644 --- a/docs/griptape-framework/drivers/src/text_to_speech_drivers_2.py +++ b/docs/griptape-framework/drivers/src/text_to_speech_drivers_2.py @@ -1,11 +1,11 @@ from griptape.drivers import OpenAiTextToSpeechDriver from griptape.engines import TextToSpeechEngine from griptape.structures import Agent -from griptape.tools.text_to_speech_client.tool import TextToSpeechClient +from griptape.tools.text_to_speech.tool import TextToSpeechTool driver = OpenAiTextToSpeechDriver() -tool = TextToSpeechClient( +tool = TextToSpeechTool( engine=TextToSpeechEngine( text_to_speech_driver=driver, ), diff --git a/docs/griptape-framework/drivers/src/web_scraper_drivers_3.py b/docs/griptape-framework/drivers/src/web_scraper_drivers_3.py index d9fe11e85..d4c77c2ae 100644 --- a/docs/griptape-framework/drivers/src/web_scraper_drivers_3.py +++ b/docs/griptape-framework/drivers/src/web_scraper_drivers_3.py @@ -1,15 +1,15 @@ from griptape.drivers import MarkdownifyWebScraperDriver from griptape.loaders import WebLoader from griptape.structures import Agent -from griptape.tools import TaskMemoryClient, WebScraper +from griptape.tools import TaskMemoryTool, WebScraperTool agent = Agent( tools=[ - WebScraper( + WebScraperTool( web_loader=WebLoader(web_scraper_driver=MarkdownifyWebScraperDriver(timeout=1000)), off_prompt=True, ), - TaskMemoryClient(off_prompt=False), + TaskMemoryTool(off_prompt=False), ], ) agent.run("List all email addresses on griptape.ai in a flat numbered markdown list.") diff --git a/docs/griptape-framework/drivers/src/web_search_drivers_2.py b/docs/griptape-framework/drivers/src/web_search_drivers_2.py index 5cde1a9a8..a33b8c00c 100644 --- a/docs/griptape-framework/drivers/src/web_search_drivers_2.py +++ b/docs/griptape-framework/drivers/src/web_search_drivers_2.py @@ -2,17 +2,17 @@ from griptape.drivers import GoogleWebSearchDriver from griptape.structures import Agent -from griptape.tools import TaskMemoryClient, WebSearch +from griptape.tools import TaskMemoryTool, WebSearchTool agent = Agent( tools=[ - WebSearch( + WebSearchTool( web_search_driver=GoogleWebSearchDriver( api_key=os.environ["GOOGLE_API_KEY"], search_id=os.environ["GOOGLE_API_SEARCH_ID"], ), ), - TaskMemoryClient(off_prompt=False), + TaskMemoryTool(off_prompt=False), ], ) agent.run("Give me some websites with information about AI frameworks.") diff --git a/docs/griptape-framework/drivers/structure-run-drivers.md b/docs/griptape-framework/drivers/structure-run-drivers.md index 00890cb4a..1f57ff57e 100644 --- a/docs/griptape-framework/drivers/structure-run-drivers.md +++ b/docs/griptape-framework/drivers/structure-run-drivers.md @@ -5,7 +5,7 @@ search: ## Overview Structure Run Drivers can be used to run Griptape Structures in a variety of runtime environments. -When combined with the [Structure Run Task](../../griptape-framework/structures/tasks.md#structure-run-task) or [Structure Run Client](../../griptape-tools/official-tools/structure-run-client.md) you can create complex, multi-agent pipelines that span multiple runtime environments. +When combined with the [Structure Run Task](../../griptape-framework/structures/tasks.md#structure-run-task) or [Structure Run Tool](../../griptape-tools/official-tools/structure-run-tool.md) you can create complex, multi-agent pipelines that span multiple runtime environments. ## Structure Run Drivers diff --git a/docs/griptape-framework/index.md b/docs/griptape-framework/index.md index 52805897d..ff3670e6e 100644 --- a/docs/griptape-framework/index.md +++ b/docs/griptape-framework/index.md @@ -103,7 +103,7 @@ Here is the chain of thought from the Agent. Notice where it realizes it can use Actions: [ { "tag": "call_RTRm7JLFV0F73dCVPmoWVJqO", - "name": "Calculator", + "name": "CalculatorTool", "path": "calculate", "input": { "values": { @@ -144,7 +144,7 @@ Agents are great for getting started, but they are intentionally limited to a si [09/08/23 10:02:53] INFO Subtask 8023e3d257274df29065b22e736faca8 Thought: Now that the webpage content is stored in memory, I can use the TaskMemory tool's summarize activity to summarize the content. - Action: {"name": "TaskMemoryClient", "path": "summarize", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "39ca67bbe26b4e1584193b87ed82170d"}}} + Action: {"name": "TaskMemoryTool", "path": "summarize", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "39ca67bbe26b4e1584193b87ed82170d"}}} [09/08/23 10:02:57] INFO Subtask 8023e3d257274df29065b22e736faca8 Response: Griptape is an open source framework that allows developers to build and deploy AI applications using large language models (LLMs). It provides the ability to create conversational and event-driven apps that diff --git a/docs/griptape-framework/misc/src/events_3.py b/docs/griptape-framework/misc/src/events_3.py index bae8b8224..2a567debe 100644 --- a/docs/griptape-framework/misc/src/events_3.py +++ b/docs/griptape-framework/misc/src/events_3.py @@ -4,7 +4,7 @@ from griptape.events import CompletionChunkEvent, EventListener, event_bus from griptape.structures import Pipeline from griptape.tasks import ToolkitTask -from griptape.tools import TaskMemoryClient, WebScraper +from griptape.tools import TaskMemoryTool, WebScraperTool event_bus.add_event_listeners( [ @@ -20,7 +20,7 @@ ToolkitTask( "Based on https://griptape.ai, tell me what griptape is.", prompt_driver=OpenAiChatPromptDriver(model="gpt-4o", stream=True), - tools=[WebScraper(off_prompt=True), TaskMemoryClient(off_prompt=False)], + tools=[WebScraperTool(off_prompt=True), TaskMemoryTool(off_prompt=False)], ) ) diff --git a/docs/griptape-framework/misc/src/events_4.py b/docs/griptape-framework/misc/src/events_4.py index f5523cb11..a66e77b1d 100644 --- a/docs/griptape-framework/misc/src/events_4.py +++ b/docs/griptape-framework/misc/src/events_4.py @@ -1,13 +1,13 @@ from griptape.structures import Pipeline from griptape.tasks import ToolkitTask -from griptape.tools import TaskMemoryClient, WebScraper +from griptape.tools import TaskMemoryTool, WebScraperTool from griptape.utils import Stream pipeline = Pipeline() pipeline.add_tasks( ToolkitTask( "Based on https://griptape.ai, tell me what griptape is.", - tools=[WebScraper(off_prompt=True), TaskMemoryClient(off_prompt=False)], + tools=[WebScraperTool(off_prompt=True), TaskMemoryTool(off_prompt=False)], ) ) diff --git a/docs/griptape-framework/src/index_3.py b/docs/griptape-framework/src/index_3.py index 043fc75f7..ac153b15f 100644 --- a/docs/griptape-framework/src/index_3.py +++ b/docs/griptape-framework/src/index_3.py @@ -1,7 +1,7 @@ from griptape.structures import Agent -from griptape.tools import Calculator +from griptape.tools import CalculatorTool -calculator = Calculator() +calculator = CalculatorTool() agent = Agent(tools=[calculator]) diff --git a/docs/griptape-framework/src/index_4.py b/docs/griptape-framework/src/index_4.py index 0bb345438..dd07280ce 100644 --- a/docs/griptape-framework/src/index_4.py +++ b/docs/griptape-framework/src/index_4.py @@ -1,7 +1,7 @@ from griptape.memory.structure import ConversationMemory from griptape.structures import Pipeline from griptape.tasks import PromptTask, ToolkitTask -from griptape.tools import FileManager, TaskMemoryClient, WebScraper +from griptape.tools import FileManagerTool, TaskMemoryTool, WebScraperTool # Pipelines represent sequences of tasks. pipeline = Pipeline(conversation_memory=ConversationMemory()) @@ -11,7 +11,7 @@ ToolkitTask( "{{ args[0] }}", # Add tools for web scraping, and file management - tools=[WebScraper(off_prompt=True), FileManager(off_prompt=True), TaskMemoryClient(off_prompt=False)], + tools=[WebScraperTool(off_prompt=True), FileManagerTool(off_prompt=True), TaskMemoryTool(off_prompt=False)], ), # Augment `input` from the previous task. PromptTask("Say the following in spanish: {{ parent_output }}"), diff --git a/docs/griptape-framework/structures/agents.md b/docs/griptape-framework/structures/agents.md index 2f28b336c..376e7288a 100644 --- a/docs/griptape-framework/structures/agents.md +++ b/docs/griptape-framework/structures/agents.md @@ -27,7 +27,7 @@ You can access the final output of the Agent by using the [output](../../referen Actions: [ { "tag": "call_ZSCH6vNoycOgtPJH2DL2U9ji", - "name": "Calculator", + "name": "CalculatorTool", "path": "calculate", "input": { "values": { diff --git a/docs/griptape-framework/structures/src/agents_1.py b/docs/griptape-framework/structures/src/agents_1.py index 20d04004d..9ce4aec22 100644 --- a/docs/griptape-framework/structures/src/agents_1.py +++ b/docs/griptape-framework/structures/src/agents_1.py @@ -1,7 +1,7 @@ from griptape.structures import Agent -from griptape.tools import Calculator +from griptape.tools import CalculatorTool -agent = Agent(input="Calculate the following: {{ args[0] }}", tools=[Calculator()]) +agent = Agent(input="Calculate the following: {{ args[0] }}", tools=[CalculatorTool()]) agent.run("what's 13^7?") print("Answer:", agent.output) diff --git a/docs/griptape-framework/structures/src/task_memory_1.py b/docs/griptape-framework/structures/src/task_memory_1.py index 90940a611..e8cfbd8ac 100644 --- a/docs/griptape-framework/structures/src/task_memory_1.py +++ b/docs/griptape-framework/structures/src/task_memory_1.py @@ -1,7 +1,7 @@ from griptape.structures import Agent -from griptape.tools import Calculator +from griptape.tools import CalculatorTool -# Create an agent with the Calculator tool -agent = Agent(tools=[Calculator(off_prompt=False)]) +# Create an agent with the CalculatorTool tool +agent = Agent(tools=[CalculatorTool(off_prompt=False)]) agent.run("What is 10 raised to the power of 5?") diff --git a/docs/griptape-framework/structures/src/task_memory_2.py b/docs/griptape-framework/structures/src/task_memory_2.py index dcc5b4d5c..9ff24e1ff 100644 --- a/docs/griptape-framework/structures/src/task_memory_2.py +++ b/docs/griptape-framework/structures/src/task_memory_2.py @@ -1,7 +1,7 @@ from griptape.structures import Agent -from griptape.tools import Calculator +from griptape.tools import CalculatorTool -# Create an agent with the Calculator tool -agent = Agent(tools=[Calculator(off_prompt=True)]) +# Create an agent with the CalculatorTool tool +agent = Agent(tools=[CalculatorTool(off_prompt=True)]) agent.run("What is 10 raised to the power of 5?") diff --git a/docs/griptape-framework/structures/src/task_memory_3.py b/docs/griptape-framework/structures/src/task_memory_3.py index cab4f4e3e..926a21cd3 100644 --- a/docs/griptape-framework/structures/src/task_memory_3.py +++ b/docs/griptape-framework/structures/src/task_memory_3.py @@ -1,7 +1,7 @@ from griptape.structures import Agent -from griptape.tools import Calculator, TaskMemoryClient +from griptape.tools import CalculatorTool, TaskMemoryTool -# Create an agent with the Calculator tool -agent = Agent(tools=[Calculator(off_prompt=True), TaskMemoryClient(off_prompt=False)]) +# Create an agent with the CalculatorTool tool +agent = Agent(tools=[CalculatorTool(off_prompt=True), TaskMemoryTool(off_prompt=False)]) agent.run("What is the square root of 12345?") diff --git a/docs/griptape-framework/structures/src/task_memory_4.py b/docs/griptape-framework/structures/src/task_memory_4.py index d192bebb7..cfd6d5711 100644 --- a/docs/griptape-framework/structures/src/task_memory_4.py +++ b/docs/griptape-framework/structures/src/task_memory_4.py @@ -1,8 +1,8 @@ from griptape.structures import Agent -from griptape.tools import WebScraper +from griptape.tools import WebScraperTool -# Create an agent with the WebScraper tool -agent = Agent(tools=[WebScraper()]) +# Create an agent with the WebScraperTool tool +agent = Agent(tools=[WebScraperTool()]) agent.run( "According to this page https://en.wikipedia.org/wiki/Elden_Ring, how many copies of Elden Ring have been sold?" diff --git a/docs/griptape-framework/structures/src/task_memory_5.py b/docs/griptape-framework/structures/src/task_memory_5.py index a5d3995a9..a53d106b4 100644 --- a/docs/griptape-framework/structures/src/task_memory_5.py +++ b/docs/griptape-framework/structures/src/task_memory_5.py @@ -1,10 +1,10 @@ from griptape.structures import Agent -from griptape.tools import TaskMemoryClient, WebScraper +from griptape.tools import TaskMemoryTool, WebScraperTool agent = Agent( tools=[ - WebScraper(off_prompt=True), - TaskMemoryClient(off_prompt=False), + WebScraperTool(off_prompt=True), + TaskMemoryTool(off_prompt=False), ] ) diff --git a/docs/griptape-framework/structures/src/task_memory_6.py b/docs/griptape-framework/structures/src/task_memory_6.py index fb5c3eabb..3f4d14b0a 100644 --- a/docs/griptape-framework/structures/src/task_memory_6.py +++ b/docs/griptape-framework/structures/src/task_memory_6.py @@ -14,7 +14,7 @@ from griptape.memory import TaskMemory from griptape.memory.task.storage import TextArtifactStorage from griptape.structures import Agent -from griptape.tools import FileManager, TaskMemoryClient, WebScraper +from griptape.tools import FileManagerTool, TaskMemoryTool, WebScraperTool config.drivers = OpenAiDriverConfig( prompt=OpenAiChatPromptDriver(model="gpt-4"), @@ -45,9 +45,9 @@ } ), tools=[ - WebScraper(off_prompt=True), - TaskMemoryClient(off_prompt=True, allowlist=["query"]), - FileManager(off_prompt=True), + WebScraperTool(off_prompt=True), + TaskMemoryTool(off_prompt=True, allowlist=["query"]), + FileManagerTool(off_prompt=True), ], ) diff --git a/docs/griptape-framework/structures/src/task_memory_7.py b/docs/griptape-framework/structures/src/task_memory_7.py index 1ffec43e8..d2f07466f 100644 --- a/docs/griptape-framework/structures/src/task_memory_7.py +++ b/docs/griptape-framework/structures/src/task_memory_7.py @@ -1,9 +1,9 @@ from griptape.structures import Agent -from griptape.tools import WebScraper +from griptape.tools import WebScraperTool agent = Agent( tools=[ - WebScraper(off_prompt=True) # `off_prompt=True` will store the data in Task Memory + WebScraperTool(off_prompt=True) # `off_prompt=True` will store the data in Task Memory # Missing a Tool that can read from Task Memory ] ) diff --git a/docs/griptape-framework/structures/src/task_memory_8.py b/docs/griptape-framework/structures/src/task_memory_8.py index 9aba9516f..846119228 100644 --- a/docs/griptape-framework/structures/src/task_memory_8.py +++ b/docs/griptape-framework/structures/src/task_memory_8.py @@ -1,12 +1,10 @@ from griptape.structures import Agent -from griptape.tools import TaskMemoryClient, WebScraper +from griptape.tools import TaskMemoryTool, WebScraperTool agent = Agent( tools=[ - WebScraper(off_prompt=True), # This tool will store the data in Task Memory - TaskMemoryClient( - off_prompt=True - ), # This tool will store the data back in Task Memory with no way to get it out + WebScraperTool(off_prompt=True), # This tool will store the data in Task Memory + TaskMemoryTool(off_prompt=True), # This tool will store the data back in Task Memory with no way to get it out ] ) agent.run( diff --git a/docs/griptape-framework/structures/src/task_memory_9.py b/docs/griptape-framework/structures/src/task_memory_9.py index c6d93ba5e..66bb562f0 100644 --- a/docs/griptape-framework/structures/src/task_memory_9.py +++ b/docs/griptape-framework/structures/src/task_memory_9.py @@ -1,9 +1,9 @@ from griptape.structures import Agent -from griptape.tools import Calculator +from griptape.tools import CalculatorTool agent = Agent( tools=[ - Calculator() # Default value of `off_prompt=False` will return the data directly to the LLM + CalculatorTool() # Default value of `off_prompt=False` will return the data directly to the LLM ] ) agent.run("What is 10 ^ 3, 55 / 23, and 12345 * 0.5?") diff --git a/docs/griptape-framework/structures/src/tasks_16.py b/docs/griptape-framework/structures/src/tasks_16.py index 796b836da..5f2e6b718 100644 --- a/docs/griptape-framework/structures/src/tasks_16.py +++ b/docs/griptape-framework/structures/src/tasks_16.py @@ -5,25 +5,25 @@ from griptape.structures import Agent, Pipeline from griptape.tasks import StructureRunTask from griptape.tools import ( - TaskMemoryClient, - WebScraper, - WebSearch, + TaskMemoryTool, + WebScraperTool, + WebSearchTool, ) def build_researcher() -> Agent: researcher = Agent( tools=[ - WebSearch( + WebSearchTool( web_search_driver=GoogleWebSearchDriver( api_key=os.environ["GOOGLE_API_KEY"], search_id=os.environ["GOOGLE_API_SEARCH_ID"], ), ), - WebScraper( + WebScraperTool( off_prompt=True, ), - TaskMemoryClient(off_prompt=False), + TaskMemoryTool(off_prompt=False), ], rulesets=[ Ruleset( diff --git a/docs/griptape-framework/structures/src/tasks_4.py b/docs/griptape-framework/structures/src/tasks_4.py index 43737980b..936b59f99 100644 --- a/docs/griptape-framework/structures/src/tasks_4.py +++ b/docs/griptape-framework/structures/src/tasks_4.py @@ -1,12 +1,12 @@ from griptape.structures import Agent from griptape.tasks import ToolkitTask -from griptape.tools import FileManager, TaskMemoryClient, WebScraper +from griptape.tools import FileManagerTool, TaskMemoryTool, WebScraperTool agent = Agent() agent.add_task( ToolkitTask( "Load https://www.griptape.ai, summarize it, and store it in a file called griptape.txt", - tools=[WebScraper(off_prompt=True), FileManager(off_prompt=True), TaskMemoryClient(off_prompt=True)], + tools=[WebScraperTool(off_prompt=True), FileManagerTool(off_prompt=True), TaskMemoryTool(off_prompt=True)], ), ) diff --git a/docs/griptape-framework/structures/src/tasks_5.py b/docs/griptape-framework/structures/src/tasks_5.py index 543543303..a0d537aa7 100644 --- a/docs/griptape-framework/structures/src/tasks_5.py +++ b/docs/griptape-framework/structures/src/tasks_5.py @@ -1,10 +1,10 @@ from griptape.structures import Agent from griptape.tasks import ToolTask -from griptape.tools import Calculator +from griptape.tools import CalculatorTool # Initialize the agent and add a task agent = Agent() -agent.add_task(ToolTask(tool=Calculator())) +agent.add_task(ToolTask(tool=CalculatorTool())) # Run the agent with a prompt agent.run("Give me the answer for 5*4.") diff --git a/docs/griptape-framework/structures/task-memory.md b/docs/griptape-framework/structures/task-memory.md index 6b858ff5b..ccc4dd1e7 100644 --- a/docs/griptape-framework/structures/task-memory.md +++ b/docs/griptape-framework/structures/task-memory.md @@ -29,15 +29,15 @@ Lets look at a simple example where `off_prompt` is set to `False`: [04/26/24 13:06:42] INFO ToolkitTask 36b9dea13b9d479fb752014f41dca54c Input: What is the square root of 12345? [04/26/24 13:06:48] INFO Subtask a88c0feeaef6493796a9148ed68c9caf - Thought: To find the square root of 12345, I can use the Calculator action with the expression "12345 ** 0.5". - Actions: [{"name": "Calculator", "path": "calculate", "input": {"values": {"expression": "12345 ** 0.5"}}, "tag": "sqrt_12345"}] + Thought: To find the square root of 12345, I can use the CalculatorTool action with the expression "12345 ** 0.5". + Actions: [{"name": "CalculatorTool", "path": "calculate", "input": {"values": {"expression": "12345 ** 0.5"}}, "tag": "sqrt_12345"}] INFO Subtask a88c0feeaef6493796a9148ed68c9caf Response: 111.1080555135405 [04/26/24 13:06:49] INFO ToolkitTask 36b9dea13b9d479fb752014f41dca54c Output: The square root of 12345 is approximately 111.108. ``` -Since the result of the Calculator Tool is neither sensitive nor too large, we can set `off_prompt` to `False` and not use Task Memory. +Since the result of the CalculatorTool Tool is neither sensitive nor too large, we can set `off_prompt` to `False` and not use Task Memory. Let's explore what happens when `off_prompt` is set to `True`: @@ -49,38 +49,38 @@ Let's explore what happens when `off_prompt` is set to `True`: [04/26/24 13:07:02] INFO ToolkitTask ecbb788d9830491ab72a8a2bbef5fb0a Input: What is the square root of 12345? [04/26/24 13:07:10] INFO Subtask 4700dc0c2e934d1a9af60a28bd770bc6 - Thought: To find the square root of a number, we can use the Calculator action with the expression "sqrt(12345)". However, the Calculator + Thought: To find the square root of a number, we can use the CalculatorTool action with the expression "sqrt(12345)". However, the CalculatorTool action only supports basic arithmetic operations and does not support the sqrt function. Therefore, we need to use the equivalent expression for square root which is raising the number to the power of 0.5. - Actions: [{"name": "Calculator", "path": "calculate", "input": {"values": {"expression": "12345**0.5"}}, "tag": "sqrt_calculation"}] + Actions: [{"name": "CalculatorTool", "path": "calculate", "input": {"values": {"expression": "12345**0.5"}}, "tag": "sqrt_calculation"}] INFO Subtask 4700dc0c2e934d1a9af60a28bd770bc6 - Response: Output of "Calculator.calculate" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "CalculatorTool.calculate" was stored in memory with memory_name "TaskMemory" and artifact_namespace "6be74c5128024c0588eb9bee1fdb9aa5" [04/26/24 13:07:16] ERROR Subtask ecbb788d9830491ab72a8a2bbef5fb0a - Invalid action JSON: Or({Literal("name", description=""): 'Calculator', Literal("path", description="Can be used for computing simple + Invalid action JSON: Or({Literal("name", description=""): 'CalculatorTool', Literal("path", description="Can be used for computing simple numerical or algebraic calculations in Python"): 'calculate', Literal("input", description=""): {'values': Schema({Literal("expression", description="Arithmetic expression parsable in pure Python. Single line only. Don't use variables. Don't use any imports or external libraries"): })}, Literal("tag", description="Unique tag name for action execution."): }) did not validate {'name': 'Memory', 'path': 'get', 'input': {'memory_name': 'TaskMemory', 'artifact_namespace': '6be74c5128024c0588eb9bee1fdb9aa5'}, 'tag': 'get_sqrt_result'} Key 'name' error: - 'Calculator' does not match 'Memory' + 'CalculatorTool' does not match 'Memory' ...Output truncated for brevity... ``` -When we set `off_prompt` to `True`, the Agent does not function as expected, even generating an error. This is because the Calculator output is being stored in Task Memory but the Agent has no way to access it. -To fix this, we need a [Tool that can read from Task Memory](#tools-that-can-read-from-task-memory) such as the `TaskMemoryClient`. +When we set `off_prompt` to `True`, the Agent does not function as expected, even generating an error. This is because the CalculatorTool output is being stored in Task Memory but the Agent has no way to access it. +To fix this, we need a [Tool that can read from Task Memory](#tools-that-can-read-from-task-memory) such as the `TaskMemoryTool`. This is an example of [not providing a Task Memory compatible Tool](#not-providing-a-task-memory-compatible-tool). -## Task Memory Client +## Task Memory Tool -The [TaskMemoryClient](../../griptape-tools/official-tools/task-memory-client.md) is a Tool that allows an Agent to interact with Task Memory. It has the following methods: +The [TaskMemoryTool](../../griptape-tools/official-tools/task-memory-tool.md) is a Tool that allows an Agent to interact with Task Memory. It has the following methods: - `query`: Retrieve the content of an Artifact stored in Task Memory. - `summarize`: Summarize the content of an Artifact stored in Task Memory. -Let's add `TaskMemoryClient` to the Agent and run the same task. -Note that on the `TaskMemoryClient` we've set `off_prompt` to `False` so that the results of the query can be returned directly to the LLM. +Let's add `TaskMemoryTool` to the Agent and run the same task. +Note that on the `TaskMemoryTool` we've set `off_prompt` to `False` so that the results of the query can be returned directly to the LLM. If we had kept it as `True`, the results would have been stored back Task Memory which would've put us back to square one. See [Task Memory Looping](#task-memory-looping) for more information on this scenario. ```python @@ -91,15 +91,15 @@ If we had kept it as `True`, the results would have been stored back Task Memory [04/26/24 13:13:01] INFO ToolkitTask 5b46f9ef677c4b31906b48aba3f45e2c Input: What is the square root of 12345? [04/26/24 13:13:07] INFO Subtask 611d98ea5576430fbc63259420577ab2 - Thought: To find the square root of 12345, I can use the Calculator action with the expression "12345 ** 0.5". - Actions: [{"name": "Calculator", "path": "calculate", "input": {"values": {"expression": "12345 ** 0.5"}}, "tag": "sqrt_12345"}] + Thought: To find the square root of 12345, I can use the CalculatorTool action with the expression "12345 ** 0.5". + Actions: [{"name": "CalculatorTool", "path": "calculate", "input": {"values": {"expression": "12345 ** 0.5"}}, "tag": "sqrt_12345"}] [04/26/24 13:13:08] INFO Subtask 611d98ea5576430fbc63259420577ab2 - Response: Output of "Calculator.calculate" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "CalculatorTool.calculate" was stored in memory with memory_name "TaskMemory" and artifact_namespace "7554b69e1d414a469b8882e2266dcea1" [04/26/24 13:13:15] INFO Subtask 32b9163a15644212be60b8fba07bd23b - Thought: The square root of 12345 has been calculated and stored in memory. I can retrieve this value using the TaskMemoryClient action with + Thought: The square root of 12345 has been calculated and stored in memory. I can retrieve this value using the TaskMemoryTool action with the query path, providing the memory_name and artifact_namespace as input. - Actions: [{"tag": "retrieve_sqrt", "name": "TaskMemoryClient", "path": "query", "input": {"values": {"memory_name": "TaskMemory", + Actions: [{"tag": "retrieve_sqrt", "name": "TaskMemoryTool", "path": "query", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "7554b69e1d414a469b8882e2266dcea1", "query": "What is the result of the calculation?"}}}] [04/26/24 13:13:16] INFO Subtask 32b9163a15644212be60b8fba07bd23b Response: The result of the calculation is 111.1080555135405. @@ -107,7 +107,7 @@ If we had kept it as `True`, the results would have been stored back Task Memory Output: The square root of 12345 is approximately 111.108. ``` -While this fixed the problem, it took a handful more steps than when we just had `Calculator()`. Something like a basic calculation is an instance of where [Task Memory may not be necessary](#task-memory-may-not-be-necessary). +While this fixed the problem, it took a handful more steps than when we just had `CalculatorTool()`. Something like a basic calculation is an instance of where [Task Memory may not be necessary](#task-memory-may-not-be-necessary). Let's look at a more complex example where Task Memory shines. ## Large Data @@ -125,8 +125,8 @@ When running this example, we get the following error: Please reduce the length of the messages.", 'type': 'invalid_request_error', 'param': 'messages', 'code': 'context_length_exceeded'}} ``` -This is because the content of the webpage is too large to fit in the LLM's input token limit. We can fix this by storing the content in Task Memory, and then querying it with the `TaskMemoryClient`. -Note that we're setting `off_prompt` to `False` on the `TaskMemoryClient` so that the _queried_ content can be returned directly to the LLM. +This is because the content of the webpage is too large to fit in the LLM's input token limit. We can fix this by storing the content in Task Memory, and then querying it with the `TaskMemoryTool`. +Note that we're setting `off_prompt` to `False` on the `TaskMemoryTool` so that the _queried_ content can be returned directly to the LLM. ```python --8<-- "docs/griptape-framework/structures/src/task_memory_5.py" @@ -146,7 +146,7 @@ And now we get the expected output: [04/26/24 13:52:11] INFO Subtask f12eb3d3b4924e4085808236b460b43d Thought: Now that the webpage content is stored in memory, I need to query this memory to find the information about how many copies of Elden Ring have been sold. - Actions: [{"tag": "query_sales", "name": "TaskMemoryClient", "path": "query", "input": {"values": {"memory_name": "TaskMemory", + Actions: [{"tag": "query_sales", "name": "TaskMemoryTool", "path": "query", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "2d4ebc7211074bb7be26613eb25d8fc1", "query": "How many copies of Elden Ring have been sold?"}}}] [04/26/24 13:52:14] INFO Subtask f12eb3d3b4924e4085808236b460b43d Response: Elden Ring sold 23 million copies by February 2024. @@ -192,13 +192,13 @@ In this example, GPT-4 _never_ sees the contents of the page, only that it was s information about how many copies of Elden Ring have been sold. Actions: [{"tag": "query_sales", "name": - "TaskMemoryClient", "path": "query", "input": + "TaskMemoryTool", "path": "query", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "7e48bcff0da94ad3b06aa4e173f8f37b", "query": "How many copies of Elden Ring have been sold?"}}}] [06/21/24 16:00:19] INFO Subtask 56102d42475d413299ce52a0230506b7 - Response: Output of "TaskMemoryClient.query" was + Response: Output of "TaskMemoryTool.query" was stored in memory with memory_name "TaskMemory" and artifact_namespace "9ecf4d7b7d0c46149dfc46ba236f178e" @@ -229,11 +229,11 @@ As seen in the previous example, certain Tools are designed to read directly fro Today, these include: -- [TaskMemoryClient](../../griptape-tools/official-tools/task-memory-client.md) -- [FileManager](../../griptape-tools/official-tools/file-manager.md) -- [AwsS3Client](../../griptape-tools/official-tools/aws-s3-client.md) -- [GoogleDriveClient](../../griptape-tools/official-tools/google-drive-client.md) -- [GoogleDocsClient](../../griptape-tools/official-tools/google-docs-client.md) +- [TaskMemoryTool](../../griptape-tools/official-tools/task-memory-tool.md) +- [FileManager](../../griptape-tools/official-tools/file-manager-tool.md) +- [AwsS3Tool](../../griptape-tools/official-tools/aws-s3-tool.md) +- [GoogleDriveTool](../../griptape-tools/official-tools/google-drive-tool.md) +- [GoogleDocsTool](../../griptape-tools/official-tools/google-docs-tool.md) ## Task Memory Considerations diff --git a/docs/griptape-framework/structures/tasks.md b/docs/griptape-framework/structures/tasks.md index a57c1e604..477ce7b64 100644 --- a/docs/griptape-framework/structures/tasks.md +++ b/docs/griptape-framework/structures/tasks.md @@ -112,7 +112,7 @@ This Task takes in one or more Tools which the LLM will decide to use through Ch [09/08/23 11:15:11] INFO Subtask a22a7e4ebf594b4b895fcbe8a95c1dd3 Thought: Now that the webpage content is stored in memory, I can use the TaskMemory tool's summarize activity to summarize it. - Action: {"name": "TaskMemoryClient", "path": "summarize", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "2b50373849d140f698ba8071066437ee"}}} + Action: {"name": "TaskMemoryTool", "path": "summarize", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "2b50373849d140f698ba8071066437ee"}}} [09/08/23 11:15:15] INFO Subtask a22a7e4ebf594b4b895fcbe8a95c1dd3 Response: Griptape is an open source framework that allows developers to build and deploy AI applications using large language models (LLMs). It provides the ability to create conversational and event-driven apps that @@ -149,7 +149,7 @@ This Task takes in a single Tool which the LLM will use without Chain of Thought [10/20/23 14:20:29] INFO Subtask a9a9ad7be2bf465fa82bd350116fabe4 Action: { - "name": "Calculator", + "name": "CalculatorTool", "path": "calculate", "input": { "values": { diff --git a/docs/griptape-framework/tools/index.md b/docs/griptape-framework/tools/index.md index c974b9658..808849dae 100644 --- a/docs/griptape-framework/tools/index.md +++ b/docs/griptape-framework/tools/index.md @@ -33,7 +33,7 @@ Here is an example of a Pipeline using Tools: [09/08/23 10:54:09] INFO Subtask 7ee08458ce154e3d970711b7d3ed79ba Thought: Now that the webpage content is stored in memory, I can use the TaskMemory tool with the summarize activity to summarize the content. - Action: {"name": "TaskMemoryClient", "path": "summarize", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "9eb6f5828cf64356bf323f11d28be27e"}}} + Action: {"name": "TaskMemoryTool", "path": "summarize", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "9eb6f5828cf64356bf323f11d28be27e"}}} [09/08/23 10:54:12] INFO Subtask 7ee08458ce154e3d970711b7d3ed79ba Response: Griptape is an open source framework that allows developers to build and deploy AI applications using large language models (LLMs). It provides the ability to create conversational and event-driven apps that diff --git a/docs/griptape-framework/tools/src/index_1.py b/docs/griptape-framework/tools/src/index_1.py index 52d8ac8e7..488dcfbc8 100644 --- a/docs/griptape-framework/tools/src/index_1.py +++ b/docs/griptape-framework/tools/src/index_1.py @@ -1,13 +1,13 @@ from griptape.structures import Pipeline from griptape.tasks import ToolkitTask -from griptape.tools import FileManager, TaskMemoryClient, WebScraper +from griptape.tools import FileManagerTool, TaskMemoryTool, WebScraperTool pipeline = Pipeline() pipeline.add_tasks( ToolkitTask( "Load https://www.griptape.ai, summarize it, and store it in a file called griptape.txt", - tools=[WebScraper(off_prompt=True), FileManager(off_prompt=True), TaskMemoryClient(off_prompt=False)], + tools=[WebScraperTool(off_prompt=True), FileManagerTool(off_prompt=True), TaskMemoryTool(off_prompt=False)], ), ) diff --git a/docs/griptape-tools/official-tools/audio-transcription-client.md b/docs/griptape-tools/official-tools/audio-transcription-tool.md similarity index 90% rename from docs/griptape-tools/official-tools/audio-transcription-client.md rename to docs/griptape-tools/official-tools/audio-transcription-tool.md index 271144d5b..ad8eeaa9b 100644 --- a/docs/griptape-tools/official-tools/audio-transcription-client.md +++ b/docs/griptape-tools/official-tools/audio-transcription-tool.md @@ -1,7 +1,7 @@ -# AudioTranscriptionClient +# Audio Transcription Tool This Tool enables [Agents](../../griptape-framework/structures/agents.md) to transcribe speech from text using [Audio Transcription Engines](../../reference/griptape/engines/audio/audio_transcription_engine.md) and [Audio Transcription Drivers](../../reference/griptape/drivers/audio_transcription/index.md). ```python ---8<-- "docs/griptape-tools/official-tools/src/audio_transcription_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/audio_transcription_tool_1.py" ``` diff --git a/docs/griptape-tools/official-tools/aws-iam-client.md b/docs/griptape-tools/official-tools/aws-iam-tool.md similarity index 89% rename from docs/griptape-tools/official-tools/aws-iam-client.md rename to docs/griptape-tools/official-tools/aws-iam-tool.md index 22b4115a3..1f594cff0 100644 --- a/docs/griptape-tools/official-tools/aws-iam-client.md +++ b/docs/griptape-tools/official-tools/aws-iam-tool.md @@ -1,22 +1,22 @@ -# AwsIamClient +# Aws Iam Tool This tool enables LLMs to make AWS IAM API requests. ```python ---8<-- "docs/griptape-tools/official-tools/src/aws_iam_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/aws_iam_tool_1.py" ``` ``` [09/11/23 16:45:45] INFO Task 890fcf77fb074c9490d5c91563e0c995 Input: List all my IAM users [09/11/23 16:45:51] INFO Subtask f2f0809ee10d4538972ed01fdd6a2fb8 Thought: To list all IAM users, I can use the - AwsIamClient tool with the list_users activity. + AwsIamTool tool with the list_users activity. This activity does not require any input. - Action: {"name": "AwsIamClient", + Action: {"name": "AwsIamTool", "path": "list_users"} [09/11/23 16:45:52] INFO Subtask f2f0809ee10d4538972ed01fdd6a2fb8 - Response: Output of "AwsIamClient.list_users" + Response: Output of "AwsIamTool.list_users" was stored in memory with memory_name "TaskMemory" and artifact_namespace "51d22a018a434904a5da3bb8d4f763f7" @@ -25,7 +25,7 @@ This tool enables LLMs to make AWS IAM API requests. stored in memory. I can retrieve this information using the TaskMemory tool with the summarize activity. - Action: {"name": "TaskMemoryClient", "path": + Action: {"name": "TaskMemoryTool", "path": "summarize", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "51d22a018a434904a5da3bb8d4f763f7"}}} diff --git a/docs/griptape-tools/official-tools/aws-s3-client.md b/docs/griptape-tools/official-tools/aws-s3-tool.md similarity index 90% rename from docs/griptape-tools/official-tools/aws-s3-client.md rename to docs/griptape-tools/official-tools/aws-s3-tool.md index 70ca79a20..9594861a9 100644 --- a/docs/griptape-tools/official-tools/aws-s3-client.md +++ b/docs/griptape-tools/official-tools/aws-s3-tool.md @@ -1,23 +1,23 @@ -# AwsS3Client +# Aws S3 Tool This tool enables LLMs to make AWS S3 API requests. ```python ---8<-- "docs/griptape-tools/official-tools/src/aws_s3_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/aws_s3_tool_1.py" ``` ``` [09/11/23 16:49:35] INFO Task 8bf7538e217a4b5a8472829f5eee75b9 Input: List all my S3 buckets. [09/11/23 16:49:41] INFO Subtask 9fc44f5c8e73447ba737283cb2ef7f5d Thought: To list all S3 buckets, I can use the - "list_s3_buckets" activity of the "AwsS3Client" + "list_s3_buckets" activity of the "AwsS3Tool" tool. This activity doesn't require any input. - Action: {"name": "AwsS3Client", + Action: {"name": "AwsS3Tool", "path": "list_s3_buckets"} [09/11/23 16:49:42] INFO Subtask 9fc44f5c8e73447ba737283cb2ef7f5d Response: Output of - "AwsS3Client.list_s3_buckets" was stored in memory + "AwsS3Tool.list_s3_buckets" was stored in memory with memory_name "TaskMemory" and artifact_namespace "f2592085fd4a430286a46770ea508cc9" @@ -26,7 +26,7 @@ This tool enables LLMs to make AWS S3 API requests. activity is stored in memory. I can retrieve this information using the "summarize" activity of the "TaskMemory" tool. - Action: {"name": "TaskMemoryClient", "path": + Action: {"name": "TaskMemoryTool", "path": "summarize", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "f2592085fd4a430286a46770ea508cc9"}}} diff --git a/docs/griptape-tools/official-tools/calculator.md b/docs/griptape-tools/official-tools/calculator-tool.md similarity index 82% rename from docs/griptape-tools/official-tools/calculator.md rename to docs/griptape-tools/official-tools/calculator-tool.md index 55ac039db..afe17a364 100644 --- a/docs/griptape-tools/official-tools/calculator.md +++ b/docs/griptape-tools/official-tools/calculator-tool.md @@ -1,9 +1,9 @@ -# Calculator +# Calculator Tool This tool enables LLMs to make simple calculations. ```python ---8<-- "docs/griptape-tools/official-tools/src/calculator_1.py" +--8<-- "docs/griptape-tools/official-tools/src/calculator_tool_1.py" ``` ``` [09/08/23 14:23:51] INFO Task bbc6002a5e5b4655bb52b6a550a1b2a5 @@ -12,9 +12,9 @@ This tool enables LLMs to make simple calculations. Thought: The question is asking for the result of 10 raised to the power of 5. This is a mathematical operation that can be performed using the - Calculator tool. + CalculatorTool tool. - Action: {"name": "Calculator", + Action: {"name": "CalculatorTool", "path": "calculate", "input": {"values": {"expression": "10**5"}}} INFO Subtask 3e9211a0f44c4277812ae410c43adbc9 diff --git a/docs/griptape-tools/official-tools/computer.md b/docs/griptape-tools/official-tools/computer-tool.md similarity index 97% rename from docs/griptape-tools/official-tools/computer.md rename to docs/griptape-tools/official-tools/computer-tool.md index 121224b20..758dd8714 100644 --- a/docs/griptape-tools/official-tools/computer.md +++ b/docs/griptape-tools/official-tools/computer-tool.md @@ -1,11 +1,11 @@ -# Computer +# Computer Tool This tool enables LLMs to execute Python code and run shell commands inside a Docker container. You have to have the Docker daemon running in order for this tool to work. You can specify a local working directory and environment variables during tool initialization: ```python ---8<-- "docs/griptape-tools/official-tools/src/computer_1.py" +--8<-- "docs/griptape-tools/official-tools/src/computer_tool_1.py" ``` ``` [09/11/23 16:24:15] INFO Task d08009ee983c4286ba10f83bcf3080e6 @@ -46,7 +46,7 @@ You can specify a local working directory and environment variables during tool in memory. I need to retrieve this output to check if "my_new_file.txt" is listed, which would confirm that the file was created successfully. - Action: {"name": "TaskMemoryClient", "path": + Action: {"name": "TaskMemoryTool", "path": "query", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "82bc4937564e4901b7fc51fced45b643", "query": "Is diff --git a/docs/griptape-tools/official-tools/date-time.md b/docs/griptape-tools/official-tools/date-time-tool.md similarity index 93% rename from docs/griptape-tools/official-tools/date-time.md rename to docs/griptape-tools/official-tools/date-time-tool.md index 76e453f39..bdc5ccbf4 100644 --- a/docs/griptape-tools/official-tools/date-time.md +++ b/docs/griptape-tools/official-tools/date-time-tool.md @@ -1,9 +1,9 @@ -# DateTime +# Date Time Tool This tool enables LLMs to get current date and time. ```python ---8<-- "docs/griptape-tools/official-tools/src/date_time_1.py" +--8<-- "docs/griptape-tools/official-tools/src/date_time_tool_1.py" ``` ``` [09/11/23 15:26:02] INFO Task d0bf49dacd8849e695494578a333f6cc diff --git a/docs/griptape-tools/official-tools/email-client.md b/docs/griptape-tools/official-tools/email-client.md deleted file mode 100644 index 66decf820..000000000 --- a/docs/griptape-tools/official-tools/email-client.md +++ /dev/null @@ -1,13 +0,0 @@ -# EmailClient - -The [EmailClient](../../reference/griptape/tools/email_client/tool.md) enables LLMs to send emails. - -```python ---8<-- "docs/griptape-tools/official-tools/src/email_client_1.py" -``` - -For debugging purposes, you can run a local SMTP server that the LLM can send emails to: - -```shell -python -m smtpd -c DebuggingServer -n localhost:1025 -``` diff --git a/docs/griptape-tools/official-tools/email-tool.md b/docs/griptape-tools/official-tools/email-tool.md new file mode 100644 index 000000000..91ba6f19b --- /dev/null +++ b/docs/griptape-tools/official-tools/email-tool.md @@ -0,0 +1,13 @@ +# Email Tool + +The [EmailTool](../../reference/griptape/tools/email/tool.md) enables LLMs to send emails. + +```python +--8<-- "docs/griptape-tools/official-tools/src/email_tool_1.py" +``` + +For debugging purposes, you can run a local SMTP server that the LLM can send emails to: + +```shell +python -m smtpd -c DebuggingServer -n localhost:1025 +``` diff --git a/docs/griptape-tools/official-tools/file-manager.md b/docs/griptape-tools/official-tools/file-manager-tool.md similarity index 94% rename from docs/griptape-tools/official-tools/file-manager.md rename to docs/griptape-tools/official-tools/file-manager-tool.md index 539c4fff4..5f27b8da5 100644 --- a/docs/griptape-tools/official-tools/file-manager.md +++ b/docs/griptape-tools/official-tools/file-manager-tool.md @@ -1,9 +1,9 @@ -# FileManager +# File Manager Tool This tool enables LLMs to save and load files. ```python ---8<-- "docs/griptape-tools/official-tools/src/file_manager_1.py" +--8<-- "docs/griptape-tools/official-tools/src/file_manager_tool_1.py" ``` ``` [09/12/23 12:07:56] INFO Task 16a1ce1847284ae3805485bad7d99116 diff --git a/docs/griptape-tools/official-tools/google-cal-client.md b/docs/griptape-tools/official-tools/google-cal-client.md deleted file mode 100644 index 9757bdcbf..000000000 --- a/docs/griptape-tools/official-tools/google-cal-client.md +++ /dev/null @@ -1,8 +0,0 @@ -# GoogleCalendarClient - -The GoogleCalendarClient tool allows you to interact with Google Calendar. - - -```python ---8<-- "docs/griptape-tools/official-tools/src/google_cal_client_1.py" -``` diff --git a/docs/griptape-tools/official-tools/google-calendar-tool.md b/docs/griptape-tools/official-tools/google-calendar-tool.md new file mode 100644 index 000000000..e0b5d9cdc --- /dev/null +++ b/docs/griptape-tools/official-tools/google-calendar-tool.md @@ -0,0 +1,8 @@ +# Google Calendar Tool + +The [GoogleCalendarTool](../../reference/griptape/tools/google_calendar/tool.md) tool allows you to interact with Google Calendar. + + +```python +--8<-- "docs/griptape-tools/official-tools/src/google_calendar_tool_1.py" +``` diff --git a/docs/griptape-tools/official-tools/google-docs-client.md b/docs/griptape-tools/official-tools/google-docs-tool.md similarity index 79% rename from docs/griptape-tools/official-tools/google-docs-client.md rename to docs/griptape-tools/official-tools/google-docs-tool.md index ff23d8e89..1f02196b9 100644 --- a/docs/griptape-tools/official-tools/google-docs-client.md +++ b/docs/griptape-tools/official-tools/google-docs-tool.md @@ -1,9 +1,9 @@ -# GoogleDocsClient +# Google Docs Tool -The GoogleDocsClient tool provides a way to interact with the Google Docs API. It can be used to create new documents, save content to existing documents, and more. +The [GoogleDocsTool](../../reference/griptape/tools/google_docs/tool.md) tool provides a way to interact with the Google Docs API. It can be used to create new documents, save content to existing documents, and more. ```python ---8<-- "docs/griptape-tools/official-tools/src/google_docs_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/google_docs_tool_1.py" ``` ``` [10/05/23 12:56:19] INFO ToolkitTask 90721b7478a74618a63d852d35be3b18 @@ -14,10 +14,10 @@ The GoogleDocsClient tool provides a way to interact with the Google Docs API. I named 'test_creation' in a folder named 'test' with the content 'Hey, Tony.'. I can use the 'save_content_to_google_doc' activity of the - GoogleDocsClient tool to achieve this. + GoogleDocsTool tool to achieve this. Action: {"name": - "GoogleDocsClient", "path": + "GoogleDocsTool", "path": "save_content_to_google_doc", "input": {"values": {"file_path": "test_creation", "content": "Hey, Tony.", "folder_path": "test"}}} diff --git a/docs/griptape-tools/official-tools/google-drive-client.md b/docs/griptape-tools/official-tools/google-drive-tool.md similarity index 77% rename from docs/griptape-tools/official-tools/google-drive-client.md rename to docs/griptape-tools/official-tools/google-drive-tool.md index 9ad3daccc..18e10ec08 100644 --- a/docs/griptape-tools/official-tools/google-drive-client.md +++ b/docs/griptape-tools/official-tools/google-drive-tool.md @@ -1,9 +1,9 @@ -# GoogleDriveClient +# Google Drive Tool -The GoogleDriveClient tool provides a way to interact with the Google Drive API. It can be used to save content on Drive, list files, and more. +The [GoogleDriveTool](../../reference/griptape/tools/google_drive/tool.md) tool provides a way to interact with the Google Drive API. It can be used to save content on Drive, list files, and more. ```python ---8<-- "docs/griptape-tools/official-tools/src/google_drive_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/google_drive_tool_1.py" ``` ``` [10/05/23 10:49:14] INFO ToolkitTask 2ae3bb7e828744f3a2631c29c6fce001 @@ -13,11 +13,11 @@ The GoogleDriveClient tool provides a way to interact with the Google Drive API. Thought: The user wants to save the content 'Hi this is Tony' in a file named 'hello.txt' to Google Drive. I can use the 'save_content_to_drive' - activity of the GoogleDriveClient tool to + activity of the GoogleDriveTool tool to accomplish this. Action: {"name": - "GoogleDriveClient", "path": + "GoogleDriveTool", "path": "save_content_to_drive", "input": {"values": {"path": "hello.txt", "content": "Hi this is Tony"}}} diff --git a/docs/griptape-tools/official-tools/google-gmail-client.md b/docs/griptape-tools/official-tools/google-gmail-tool.md similarity index 78% rename from docs/griptape-tools/official-tools/google-gmail-client.md rename to docs/griptape-tools/official-tools/google-gmail-tool.md index fe6952dc3..1a9e6ea47 100644 --- a/docs/griptape-tools/official-tools/google-gmail-client.md +++ b/docs/griptape-tools/official-tools/google-gmail-tool.md @@ -1,9 +1,9 @@ -# GoogleGmailClient +# Google Gmail Tool -The GoogleGmailClient tool provides a way to interact with the Gmail API. It can be used to create draft emails, send emails, and more. +The [GoogleGmailTool](../../reference/griptape/tools/google_gmail/tool.md) tool provides a way to interact with the Gmail API. It can be used to create draft emails, send emails, and more. ```python ---8<-- "docs/griptape-tools/official-tools/src/google_gmail_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/google_gmail_tool_1.py" ``` ``` [10/05/23 13:24:05] INFO ToolkitTask 1f190f823d584053bfe9942f41b6cb2d @@ -12,13 +12,13 @@ The GoogleGmailClient tool provides a way to interact with the Gmail API. It can the body 'This is a test draft email.' [10/05/23 13:24:15] INFO Subtask 7f2cce7e5b0e425ba696531561697b96 Thought: The user wants to create a draft email in - Gmail. I can use the GoogleGmailClient tool with + Gmail. I can use the GoogleGmailTool tool with the create_draft_email activity to accomplish this. I will need to provide the 'to', 'subject', and 'body' values as input. Action: {"name": - "GoogleGmailClient", "path": + "GoogleGmailTool", "path": "create_draft_email", "input": {"values": {"to": "example@email.com", "subject": "Test Draft", "body": "This is a test draft email."}}} diff --git a/docs/griptape-tools/official-tools/griptape-cloud-knowledge-base-client.md b/docs/griptape-tools/official-tools/griptape-cloud-knowledge-base-client.md deleted file mode 100644 index 28e89b4bb..000000000 --- a/docs/griptape-tools/official-tools/griptape-cloud-knowledge-base-client.md +++ /dev/null @@ -1,9 +0,0 @@ -## Overview - -The `GriptapeCloudKnowledgeBaseClient` is a lightweight Tool to retrieve data from a RAG pipeline and vector store hosted in [Griptape Cloud](https://cloud.griptape.ai). It enables searching across a centralized [Knowledge Base](https://cloud.griptape.ai/knowledge-bases) that can consist of various data sources such as Confluence, Google Docs, and web pages. - -**Note:** This tool requires a [Knowledge Base](https://cloud.griptape.ai/knowledge-bases) hosted in Griptape Cloud and an [API Key](https://cloud.griptape.ai/account/api-keys) for access. - -```python ---8<-- "docs/griptape-tools/official-tools/src/griptape_cloud_knowledge_base_client_1.py" -``` diff --git a/docs/griptape-tools/official-tools/griptape-cloud-knowledge-base-tool.md b/docs/griptape-tools/official-tools/griptape-cloud-knowledge-base-tool.md new file mode 100644 index 000000000..96af51782 --- /dev/null +++ b/docs/griptape-tools/official-tools/griptape-cloud-knowledge-base-tool.md @@ -0,0 +1,9 @@ +# Griptape Cloud Knowledge Base Tool + +The [GriptapeCloudKnowledgeBaseTool](../../reference/griptape/tools/griptape_cloud_knowledge_base/tool.md) is a lightweight Tool to retrieve data from a RAG pipeline and vector store hosted in [Griptape Cloud](https://cloud.griptape.ai). It enables searching across a centralized [Knowledge Base](https://cloud.griptape.ai/knowledge-bases) that can consist of various data sources such as Confluence, Google Docs, and web pages. + +**Note:** This tool requires a [Knowledge Base](https://cloud.griptape.ai/knowledge-bases) hosted in Griptape Cloud and an [API Key](https://cloud.griptape.ai/account/api-keys) for access. + +```python +--8<-- "docs/griptape-tools/official-tools/src/griptape_cloud_knowledge_base_tool_1.py" +``` diff --git a/docs/griptape-tools/official-tools/image-query-client.md b/docs/griptape-tools/official-tools/image-query-tool.md similarity index 58% rename from docs/griptape-tools/official-tools/image-query-client.md rename to docs/griptape-tools/official-tools/image-query-tool.md index ae02d127c..781a279a8 100644 --- a/docs/griptape-tools/official-tools/image-query-client.md +++ b/docs/griptape-tools/official-tools/image-query-tool.md @@ -1,7 +1,7 @@ -# ImageQueryClient +# Image Query Tool This tool allows Agents to execute natural language queries on the contents of images using multimodal models. ```python ---8<-- "docs/griptape-tools/official-tools/src/image_query_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/image_query_tool_1.py" ``` diff --git a/docs/griptape-tools/official-tools/inpainting-image-generation-client.md b/docs/griptape-tools/official-tools/inpainting-image-generation-tool.md similarity index 87% rename from docs/griptape-tools/official-tools/inpainting-image-generation-client.md rename to docs/griptape-tools/official-tools/inpainting-image-generation-tool.md index 65de566ad..7abdc6238 100644 --- a/docs/griptape-tools/official-tools/inpainting-image-generation-client.md +++ b/docs/griptape-tools/official-tools/inpainting-image-generation-tool.md @@ -1,7 +1,7 @@ -# InpaintingImageGenerationClient +# Inpainting Image Generation Tool This tool allows LLMs to generate images using inpainting, where an input image is altered within the area specified by a mask image according to a prompt. The input and mask images can be provided either by their file path or by their [Task Memory](../../griptape-framework/structures/task-memory.md) references. ```python ---8<-- "docs/griptape-tools/official-tools/src/inpainting_image_generation_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/inpainting_image_generation_tool_1.py" ``` diff --git a/docs/griptape-tools/official-tools/openweather-client.md b/docs/griptape-tools/official-tools/openweather-client.md deleted file mode 100644 index 3521733c5..000000000 --- a/docs/griptape-tools/official-tools/openweather-client.md +++ /dev/null @@ -1,7 +0,0 @@ -# OpenWeatherClient - -The [OpenWeatherClient](../../reference/griptape/tools/openweather_client/tool.md) enables LLMs to use [OpenWeatherMap](https://openweathermap.org/). - -```python ---8<-- "docs/griptape-tools/official-tools/src/openweather_client_1.py" -``` diff --git a/docs/griptape-tools/official-tools/openweather-tool.md b/docs/griptape-tools/official-tools/openweather-tool.md new file mode 100644 index 000000000..be1ed3972 --- /dev/null +++ b/docs/griptape-tools/official-tools/openweather-tool.md @@ -0,0 +1,7 @@ +# Open Weather Tool + +The [OpenWeatherTool](../../reference/griptape/tools/openweather/tool.md) enables LLMs to use [OpenWeatherMap](https://openweathermap.org/). + +```python +--8<-- "docs/griptape-tools/official-tools/src/openweather_tool_1.py" +``` diff --git a/docs/griptape-tools/official-tools/outpainting-image-generation-client.md b/docs/griptape-tools/official-tools/outpainting-image-generation-tool.md similarity index 86% rename from docs/griptape-tools/official-tools/outpainting-image-generation-client.md rename to docs/griptape-tools/official-tools/outpainting-image-generation-tool.md index e62a40a73..ce97798bc 100644 --- a/docs/griptape-tools/official-tools/outpainting-image-generation-client.md +++ b/docs/griptape-tools/official-tools/outpainting-image-generation-tool.md @@ -1,7 +1,7 @@ -# OutpaintingImageGenerationClient +# Outpainting Image Generation Tool This tool allows LLMs to generate images using outpainting, where an input image is altered outside of the area specified by a mask image according to a prompt. The input and mask images can be provided either by their file path or by their [Task Memory](../../griptape-framework/structures/task-memory.md) references. ```python ---8<-- "docs/griptape-tools/official-tools/src/outpainting_image_generation_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/outpainting_image_generation_tool_1.py" ``` diff --git a/docs/griptape-tools/official-tools/prompt-image-generation-client.md b/docs/griptape-tools/official-tools/prompt-image-generation-tool.md similarity index 73% rename from docs/griptape-tools/official-tools/prompt-image-generation-client.md rename to docs/griptape-tools/official-tools/prompt-image-generation-tool.md index d91b154be..c764791dc 100644 --- a/docs/griptape-tools/official-tools/prompt-image-generation-client.md +++ b/docs/griptape-tools/official-tools/prompt-image-generation-tool.md @@ -1,7 +1,7 @@ -# PromptImageGenerationClient +# Prompt Image Generation Tool This tool allows LLMs to generate images from a text prompt. ```python ---8<-- "docs/griptape-tools/official-tools/src/prompt_image_generation_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/prompt_image_generation_tool_1.py" ``` diff --git a/docs/griptape-tools/official-tools/rag-client.md b/docs/griptape-tools/official-tools/rag-tool.md similarity index 86% rename from docs/griptape-tools/official-tools/rag-client.md rename to docs/griptape-tools/official-tools/rag-tool.md index c90762946..71613beab 100644 --- a/docs/griptape-tools/official-tools/rag-client.md +++ b/docs/griptape-tools/official-tools/rag-tool.md @@ -1,9 +1,11 @@ -The [RagClient](../../reference/griptape/tools/rag_client/tool.md) enables LLMs to query modular RAG engines. +# Rag Tool + +The [RagTool](../../reference/griptape/tools/rag/tool.md) enables LLMs to query modular RAG engines. Here is an example of how it can be used with a local vector store driver: ```python ---8<-- "docs/griptape-tools/official-tools/src/rag_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/rag_tool_1.py" ``` ``` [07/11/24 13:30:43] INFO ToolkitTask a6d057d5c71d4e9cb6863a2adb64b76c @@ -12,7 +14,7 @@ Here is an example of how it can be used with a local vector store driver: Actions: [ { "tag": "call_4MaDzOuKnWAs2gmhK3KJhtjI", - "name": "RagClient", + "name": "RagTool", "path": "search", "input": { "values": { diff --git a/docs/griptape-tools/official-tools/rest-api-client.md b/docs/griptape-tools/official-tools/rest-api-tool.md similarity index 50% rename from docs/griptape-tools/official-tools/rest-api-client.md rename to docs/griptape-tools/official-tools/rest-api-tool.md index 8ec4804c2..345f0589b 100644 --- a/docs/griptape-tools/official-tools/rest-api-client.md +++ b/docs/griptape-tools/official-tools/rest-api-tool.md @@ -1,12 +1,12 @@ -# RestApiClient +# Rest Api Tool This tool enables LLMs to call REST APIs. -The [RestApiClient](../../reference/griptape/tools/rest_api_client/tool.md) tool uses the following parameters: +The [RestApiTool](../../reference/griptape/tools/rest_api/tool.md) tool uses the following parameters: ### Example The following example is built using [https://jsonplaceholder.typicode.com/guide/](https://jsonplaceholder.typicode.com/guide/). ```python ---8<-- "docs/griptape-tools/official-tools/src/rest_api_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/rest_api_tool_1.py" ``` diff --git a/docs/griptape-tools/official-tools/sql-client.md b/docs/griptape-tools/official-tools/sql-tool.md similarity index 90% rename from docs/griptape-tools/official-tools/sql-client.md rename to docs/griptape-tools/official-tools/sql-tool.md index 1d0d7abb0..b20327013 100644 --- a/docs/griptape-tools/official-tools/sql-client.md +++ b/docs/griptape-tools/official-tools/sql-tool.md @@ -1,23 +1,23 @@ -# SqlClient +# Sql Tool This tool enables LLMs to execute SQL statements via [SQLAlchemy](https://www.sqlalchemy.org/). Depending on your underlying SQL engine, [configure](https://docs.sqlalchemy.org/en/20/core/engines.html) your `engine_url` and give the LLM a hint about what engine you are using via `engine_name`, so that it can create engine-specific statements. ```python ---8<-- "docs/griptape-tools/official-tools/src/sql_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/sql_tool_1.py" ``` ``` [09/11/23 17:02:55] INFO Task d8331f8705b64b4b9d9a88137ed73f3f Input: SELECT * FROM people; [09/11/23 17:03:02] INFO Subtask 46c2f8926ce9469e9ca6b1b3364e3e41 Thought: The user wants to retrieve all records - from the 'people' table. I can use the SqlClient + from the 'people' table. I can use the SqlTool tool to execute this query. - Action: {"name": "SqlClient", + Action: {"name": "SqlTool", "path": "execute_query", "input": {"values": {"sql_query": "SELECT * FROM people;"}}} [09/11/23 17:03:03] INFO Subtask 46c2f8926ce9469e9ca6b1b3364e3e41 - Response: Output of "SqlClient.execute_query" + Response: Output of "SqlTool.execute_query" was stored in memory with memory_name "TaskMemory" and artifact_namespace "217715ba3e444e4985bee223df5716a8" @@ -25,7 +25,7 @@ This tool enables LLMs to execute SQL statements via [SQLAlchemy](https://www.sq Thought: The output of the SQL query has been stored in memory. I can retrieve this data using the TaskMemory's 'summarize' activity. - Action: {"name": "TaskMemoryClient", "path": + Action: {"name": "TaskMemoryTool", "path": "summarize", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "217715ba3e444e4985bee223df5716a8"}}} diff --git a/docs/griptape-tools/official-tools/src/audio_transcription_client_1.py b/docs/griptape-tools/official-tools/src/audio_transcription_tool_1.py similarity index 79% rename from docs/griptape-tools/official-tools/src/audio_transcription_client_1.py rename to docs/griptape-tools/official-tools/src/audio_transcription_tool_1.py index d2c54e0c9..bc25fd1fa 100644 --- a/docs/griptape-tools/official-tools/src/audio_transcription_client_1.py +++ b/docs/griptape-tools/official-tools/src/audio_transcription_tool_1.py @@ -1,11 +1,11 @@ from griptape.drivers import OpenAiAudioTranscriptionDriver from griptape.engines import AudioTranscriptionEngine from griptape.structures import Agent -from griptape.tools.audio_transcription_client.tool import AudioTranscriptionClient +from griptape.tools.audio_transcription.tool import AudioTranscriptionTool driver = OpenAiAudioTranscriptionDriver(model="whisper-1") -tool = AudioTranscriptionClient( +tool = AudioTranscriptionTool( off_prompt=False, engine=AudioTranscriptionEngine( audio_transcription_driver=driver, diff --git a/docs/griptape-tools/official-tools/src/aws_iam_client_1.py b/docs/griptape-tools/official-tools/src/aws_iam_tool_1.py similarity index 72% rename from docs/griptape-tools/official-tools/src/aws_iam_client_1.py rename to docs/griptape-tools/official-tools/src/aws_iam_tool_1.py index 8fda31553..89718010f 100644 --- a/docs/griptape-tools/official-tools/src/aws_iam_client_1.py +++ b/docs/griptape-tools/official-tools/src/aws_iam_tool_1.py @@ -1,10 +1,10 @@ import boto3 from griptape.structures import Agent -from griptape.tools import AwsIamClient +from griptape.tools import AwsIamTool # Initialize the AWS IAM client -aws_iam_client = AwsIamClient(session=boto3.Session()) +aws_iam_client = AwsIamTool(session=boto3.Session()) # Create an agent with the AWS IAM client tool agent = Agent(tools=[aws_iam_client]) diff --git a/docs/griptape-tools/official-tools/src/aws_s3_client_1.py b/docs/griptape-tools/official-tools/src/aws_s3_tool_1.py similarity index 50% rename from docs/griptape-tools/official-tools/src/aws_s3_client_1.py rename to docs/griptape-tools/official-tools/src/aws_s3_tool_1.py index e1ba42525..973a0b881 100644 --- a/docs/griptape-tools/official-tools/src/aws_s3_client_1.py +++ b/docs/griptape-tools/official-tools/src/aws_s3_tool_1.py @@ -1,13 +1,13 @@ import boto3 from griptape.structures import Agent -from griptape.tools import AwsS3Client, TaskMemoryClient +from griptape.tools import AwsS3Tool, TaskMemoryTool # Initialize the AWS S3 client -aws_s3_client = AwsS3Client(session=boto3.Session(), off_prompt=True) +aws_s3_client = AwsS3Tool(session=boto3.Session(), off_prompt=True) # Create an agent with the AWS S3 client tool -agent = Agent(tools=[aws_s3_client, TaskMemoryClient(off_prompt=False)]) +agent = Agent(tools=[aws_s3_client, TaskMemoryTool(off_prompt=False)]) # Task to list all the AWS S3 buckets agent.run("List all my S3 buckets.") diff --git a/docs/griptape-tools/official-tools/src/calculator_1.py b/docs/griptape-tools/official-tools/src/calculator_tool_1.py similarity index 56% rename from docs/griptape-tools/official-tools/src/calculator_1.py rename to docs/griptape-tools/official-tools/src/calculator_tool_1.py index b28bb92b2..1263cad45 100644 --- a/docs/griptape-tools/official-tools/src/calculator_1.py +++ b/docs/griptape-tools/official-tools/src/calculator_tool_1.py @@ -1,8 +1,8 @@ from griptape.structures import Agent -from griptape.tools import Calculator +from griptape.tools import CalculatorTool -# Create an agent with the Calculator tool -agent = Agent(tools=[Calculator()]) +# Create an agent with the CalculatorTool tool +agent = Agent(tools=[CalculatorTool()]) # Run the agent with a task to perform the arithmetic calculation of \(10^5\) agent.run("What is 10 raised to the power of 5?") diff --git a/docs/griptape-tools/official-tools/src/computer_1.py b/docs/griptape-tools/official-tools/src/computer_tool_1.py similarity index 77% rename from docs/griptape-tools/official-tools/src/computer_1.py rename to docs/griptape-tools/official-tools/src/computer_tool_1.py index 7fa22a46b..b0892d425 100644 --- a/docs/griptape-tools/official-tools/src/computer_1.py +++ b/docs/griptape-tools/official-tools/src/computer_tool_1.py @@ -1,10 +1,10 @@ from griptape.structures import Agent -from griptape.tools import Computer +from griptape.tools import ComputerTool -# Initialize the Computer tool -computer = Computer() +# Initialize the ComputerTool tool +computer = ComputerTool() -# Create an agent with the Computer tool +# Create an agent with the ComputerTool tool agent = Agent(tools=[computer]) # Create a file using the shell command diff --git a/docs/griptape-tools/official-tools/src/date_time_1.py b/docs/griptape-tools/official-tools/src/date_time_1.py deleted file mode 100644 index 735b77307..000000000 --- a/docs/griptape-tools/official-tools/src/date_time_1.py +++ /dev/null @@ -1,8 +0,0 @@ -from griptape.structures import Agent -from griptape.tools import DateTime - -# Create an agent with the DateTime tool -agent = Agent(tools=[DateTime()]) - -# Fetch the current date and time -agent.run("What is the current date and time?") diff --git a/docs/griptape-tools/official-tools/src/date_time_tool_1.py b/docs/griptape-tools/official-tools/src/date_time_tool_1.py new file mode 100644 index 000000000..f806e5091 --- /dev/null +++ b/docs/griptape-tools/official-tools/src/date_time_tool_1.py @@ -0,0 +1,8 @@ +from griptape.structures import Agent +from griptape.tools import DateTimeTool + +# Create an agent with the DateTimeTool tool +agent = Agent(tools=[DateTimeTool()]) + +# Fetch the current date and time +agent.run("What is the current date and time?") diff --git a/docs/griptape-tools/official-tools/src/email_client_1.py b/docs/griptape-tools/official-tools/src/email_tool_1.py similarity index 79% rename from docs/griptape-tools/official-tools/src/email_client_1.py rename to docs/griptape-tools/official-tools/src/email_tool_1.py index e93a74f34..e9d3b3cee 100644 --- a/docs/griptape-tools/official-tools/src/email_client_1.py +++ b/docs/griptape-tools/official-tools/src/email_tool_1.py @@ -1,8 +1,8 @@ import os -from griptape.tools import EmailClient +from griptape.tools import EmailTool -email_client = EmailClient( +email_tool = EmailTool( smtp_host=os.environ.get("SMTP_HOST"), smtp_port=int(os.environ.get("SMTP_PORT", 465)), smtp_password=os.environ.get("SMTP_PASSWORD"), diff --git a/docs/griptape-tools/official-tools/src/file_manager_1.py b/docs/griptape-tools/official-tools/src/file_manager_tool_1.py similarity index 73% rename from docs/griptape-tools/official-tools/src/file_manager_1.py rename to docs/griptape-tools/official-tools/src/file_manager_tool_1.py index 16adf669c..0b5596d2b 100644 --- a/docs/griptape-tools/official-tools/src/file_manager_1.py +++ b/docs/griptape-tools/official-tools/src/file_manager_tool_1.py @@ -1,10 +1,10 @@ from pathlib import Path from griptape.structures import Agent -from griptape.tools import FileManager +from griptape.tools import FileManagerTool -# Initialize the FileManager tool with the current directory as its base -file_manager_tool = FileManager() +# Initialize the FileManagerTool tool with the current directory as its base +file_manager_tool = FileManagerTool() # Add the tool to the Agent agent = Agent(tools=[file_manager_tool]) diff --git a/docs/griptape-tools/official-tools/src/google_cal_client_1.py b/docs/griptape-tools/official-tools/src/google_calendar_tool_1.py similarity index 79% rename from docs/griptape-tools/official-tools/src/google_cal_client_1.py rename to docs/griptape-tools/official-tools/src/google_calendar_tool_1.py index 1b99d9ec4..afbb20c9f 100644 --- a/docs/griptape-tools/official-tools/src/google_cal_client_1.py +++ b/docs/griptape-tools/official-tools/src/google_calendar_tool_1.py @@ -1,10 +1,10 @@ import os from griptape.structures import Agent -from griptape.tools import GoogleCalendarClient +from griptape.tools import GoogleCalendarTool -# Create the GoogleCalendarClient tool -google_calendar_tool = GoogleCalendarClient( +# Create the GoogleCalendarTool tool +google_calendarendar_tool = GoogleCalendarTool( service_account_credentials={ "type": os.environ["GOOGLE_ACCOUNT_TYPE"], "project_id": os.environ["GOOGLE_PROJECT_ID"], @@ -20,8 +20,8 @@ owner_email=os.environ["GOOGLE_OWNER_EMAIL"], ) -# Set up an agent using the GoogleCalendarClient tool -agent = Agent(tools=[google_calendar_tool]) +# Set up an agent using the GoogleCalendarTool tool +agent = Agent(tools=[google_calendarendar_tool]) # Task: Get upcoming events from a Google calendar agent.run( diff --git a/docs/griptape-tools/official-tools/src/google_docs_client_1.py b/docs/griptape-tools/official-tools/src/google_docs_tool_1.py similarity index 85% rename from docs/griptape-tools/official-tools/src/google_docs_client_1.py rename to docs/griptape-tools/official-tools/src/google_docs_tool_1.py index 473bfbfd8..0d8e8a3cb 100644 --- a/docs/griptape-tools/official-tools/src/google_docs_client_1.py +++ b/docs/griptape-tools/official-tools/src/google_docs_tool_1.py @@ -1,10 +1,10 @@ import os from griptape.structures import Agent -from griptape.tools import GoogleDocsClient +from griptape.tools import GoogleDocsTool -# Create the GoogleDocsClient tool -google_docs_tool = GoogleDocsClient( +# Create the GoogleDocsTool tool +google_docs_tool = GoogleDocsTool( service_account_credentials={ "type": os.environ["GOOGLE_ACCOUNT_TYPE"], "project_id": os.environ["GOOGLE_PROJECT_ID"], @@ -20,7 +20,7 @@ owner_email=os.environ["GOOGLE_OWNER_EMAIL"], ) -# Set up an agent using the GoogleDocsClient tool +# Set up an agent using the GoogleDocsTool tool agent = Agent(tools=[google_docs_tool]) # Task: Create a new Google Doc and save content to it diff --git a/docs/griptape-tools/official-tools/src/google_drive_client_1.py b/docs/griptape-tools/official-tools/src/google_drive_tool_1.py similarity index 84% rename from docs/griptape-tools/official-tools/src/google_drive_client_1.py rename to docs/griptape-tools/official-tools/src/google_drive_tool_1.py index a020b1a96..d8e43a6db 100644 --- a/docs/griptape-tools/official-tools/src/google_drive_client_1.py +++ b/docs/griptape-tools/official-tools/src/google_drive_tool_1.py @@ -1,10 +1,10 @@ import os from griptape.structures import Agent -from griptape.tools import GoogleDriveClient +from griptape.tools import GoogleDriveTool -# Create the GoogleDriveClient tool -google_drive_tool = GoogleDriveClient( +# Create the GoogleDriveTool tool +google_drive_tool = GoogleDriveTool( service_account_credentials={ "type": os.environ["GOOGLE_ACCOUNT_TYPE"], "project_id": os.environ["GOOGLE_PROJECT_ID"], @@ -20,7 +20,7 @@ owner_email=os.environ["GOOGLE_OWNER_EMAIL"], ) -# Set up an agent using the GoogleDriveClient tool +# Set up an agent using the GoogleDriveTool tool agent = Agent(tools=[google_drive_tool]) # Task: Save content to my Google Drive (default directory is root) diff --git a/docs/griptape-tools/official-tools/src/google_gmail_client_1.py b/docs/griptape-tools/official-tools/src/google_gmail_tool_1.py similarity index 85% rename from docs/griptape-tools/official-tools/src/google_gmail_client_1.py rename to docs/griptape-tools/official-tools/src/google_gmail_tool_1.py index e9a075fa8..44e0ceb39 100644 --- a/docs/griptape-tools/official-tools/src/google_gmail_client_1.py +++ b/docs/griptape-tools/official-tools/src/google_gmail_tool_1.py @@ -1,10 +1,10 @@ import os from griptape.structures import Agent -from griptape.tools import GoogleGmailClient +from griptape.tools import GoogleGmailTool -# Create the GoogleGmailClient tool -gmail_tool = GoogleGmailClient( +# Create the GoogleGmailTool tool +gmail_tool = GoogleGmailTool( service_account_credentials={ "type": os.environ["GOOGLE_ACCOUNT_TYPE"], "project_id": os.environ["GOOGLE_PROJECT_ID"], @@ -20,7 +20,7 @@ owner_email=os.environ["GOOGLE_OWNER_EMAIL"], ) -# Set up an agent using the GoogleGmailClient tool +# Set up an agent using the GoogleGmailTool tool agent = Agent(tools=[gmail_tool]) # Task: Create a draft email in GMail diff --git a/docs/griptape-tools/official-tools/src/griptape_cloud_knowledge_base_client_1.py b/docs/griptape-tools/official-tools/src/griptape_cloud_knowledge_base_tool_1.py similarity index 75% rename from docs/griptape-tools/official-tools/src/griptape_cloud_knowledge_base_client_1.py rename to docs/griptape-tools/official-tools/src/griptape_cloud_knowledge_base_tool_1.py index 9cfd09a22..b8c294f6b 100644 --- a/docs/griptape-tools/official-tools/src/griptape_cloud_knowledge_base_client_1.py +++ b/docs/griptape-tools/official-tools/src/griptape_cloud_knowledge_base_tool_1.py @@ -1,9 +1,9 @@ import os from griptape.structures import Agent -from griptape.tools import GriptapeCloudKnowledgeBaseClient +from griptape.tools import GriptapeCloudKnowledgeBaseTool -knowledge_base_client = GriptapeCloudKnowledgeBaseClient( +knowledge_base_client = GriptapeCloudKnowledgeBaseTool( description="Contains information about the company and its operations", api_key=os.environ["GRIPTAPE_CLOUD_API_KEY"], knowledge_base_id=os.environ["GRIPTAPE_CLOUD_KB_ID"], diff --git a/docs/griptape-tools/official-tools/src/image_query_client_1.py b/docs/griptape-tools/official-tools/src/image_query_tool_1.py similarity index 80% rename from docs/griptape-tools/official-tools/src/image_query_client_1.py rename to docs/griptape-tools/official-tools/src/image_query_tool_1.py index 177154d2d..a4d69eafb 100644 --- a/docs/griptape-tools/official-tools/src/image_query_client_1.py +++ b/docs/griptape-tools/official-tools/src/image_query_tool_1.py @@ -1,7 +1,7 @@ from griptape.drivers import OpenAiImageQueryDriver from griptape.engines import ImageQueryEngine from griptape.structures import Agent -from griptape.tools import ImageQueryClient +from griptape.tools import ImageQueryTool # Create an Image Query Driver. driver = OpenAiImageQueryDriver(model="gpt-4o") @@ -11,8 +11,8 @@ image_query_driver=driver, ) -# Create an Image Query Client configured to use the engine. -tool = ImageQueryClient( +# Create an Image Query Tool configured to use the engine. +tool = ImageQueryTool( image_query_engine=engine, ) diff --git a/docs/griptape-tools/official-tools/src/inpainting_image_generation_client_1.py b/docs/griptape-tools/official-tools/src/inpainting_image_generation_tool_1.py similarity index 90% rename from docs/griptape-tools/official-tools/src/inpainting_image_generation_client_1.py rename to docs/griptape-tools/official-tools/src/inpainting_image_generation_tool_1.py index 1042a4567..5821e1b40 100644 --- a/docs/griptape-tools/official-tools/src/inpainting_image_generation_client_1.py +++ b/docs/griptape-tools/official-tools/src/inpainting_image_generation_tool_1.py @@ -1,7 +1,7 @@ from griptape.drivers import AmazonBedrockImageGenerationDriver, BedrockStableDiffusionImageGenerationModelDriver from griptape.engines import InpaintingImageGenerationEngine from griptape.structures import Agent -from griptape.tools import InpaintingImageGenerationClient +from griptape.tools import InpaintingImageGenerationTool # Create a driver configured to use Stable Diffusion via Bedrock. driver = AmazonBedrockImageGenerationDriver( @@ -15,7 +15,7 @@ ) # Create a tool configured to use the engine. -tool = InpaintingImageGenerationClient( +tool = InpaintingImageGenerationTool( engine=engine, ) diff --git a/docs/griptape-tools/official-tools/src/openweather_client_1.py b/docs/griptape-tools/official-tools/src/openweather_tool_1.py similarity index 75% rename from docs/griptape-tools/official-tools/src/openweather_client_1.py rename to docs/griptape-tools/official-tools/src/openweather_tool_1.py index 2156e24da..b592620fa 100644 --- a/docs/griptape-tools/official-tools/src/openweather_client_1.py +++ b/docs/griptape-tools/official-tools/src/openweather_tool_1.py @@ -1,11 +1,11 @@ import os from griptape.structures import Agent -from griptape.tools import OpenWeatherClient +from griptape.tools import OpenWeatherTool agent = Agent( tools=[ - OpenWeatherClient( + OpenWeatherTool( api_key=os.environ["OPENWEATHER_API_KEY"], ), ] diff --git a/docs/griptape-tools/official-tools/src/outpainting_image_generation_client_1.py b/docs/griptape-tools/official-tools/src/outpainting_image_generation_tool_1.py similarity index 89% rename from docs/griptape-tools/official-tools/src/outpainting_image_generation_client_1.py rename to docs/griptape-tools/official-tools/src/outpainting_image_generation_tool_1.py index bc7eb8585..79606a965 100644 --- a/docs/griptape-tools/official-tools/src/outpainting_image_generation_client_1.py +++ b/docs/griptape-tools/official-tools/src/outpainting_image_generation_tool_1.py @@ -1,7 +1,7 @@ from griptape.drivers import AmazonBedrockImageGenerationDriver, BedrockStableDiffusionImageGenerationModelDriver from griptape.engines import OutpaintingImageGenerationEngine from griptape.structures import Agent -from griptape.tools import OutpaintingImageGenerationClient +from griptape.tools import OutpaintingImageGenerationTool # Create a driver configured to use Stable Diffusion via Bedrock. driver = AmazonBedrockImageGenerationDriver( @@ -15,7 +15,7 @@ ) # Create a tool configured to use the engine. -tool = OutpaintingImageGenerationClient( +tool = OutpaintingImageGenerationTool( engine=engine, ) diff --git a/docs/griptape-tools/official-tools/src/prompt_image_generation_client_1.py b/docs/griptape-tools/official-tools/src/prompt_image_generation_tool_1.py similarity index 89% rename from docs/griptape-tools/official-tools/src/prompt_image_generation_client_1.py rename to docs/griptape-tools/official-tools/src/prompt_image_generation_tool_1.py index f75f904b6..0173cc185 100644 --- a/docs/griptape-tools/official-tools/src/prompt_image_generation_client_1.py +++ b/docs/griptape-tools/official-tools/src/prompt_image_generation_tool_1.py @@ -1,7 +1,7 @@ from griptape.drivers import AmazonBedrockImageGenerationDriver, BedrockStableDiffusionImageGenerationModelDriver from griptape.engines import PromptImageGenerationEngine from griptape.structures import Agent -from griptape.tools import PromptImageGenerationClient +from griptape.tools import PromptImageGenerationTool # Create a driver configured to use Stable Diffusion via Bedrock. driver = AmazonBedrockImageGenerationDriver( @@ -15,7 +15,7 @@ ) # Create a tool configured to use the engine. -tool = PromptImageGenerationClient( +tool = PromptImageGenerationTool( engine=engine, ) diff --git a/docs/griptape-tools/official-tools/src/rag_client_1.py b/docs/griptape-tools/official-tools/src/rag_tool_1.py similarity index 93% rename from docs/griptape-tools/official-tools/src/rag_client_1.py rename to docs/griptape-tools/official-tools/src/rag_tool_1.py index 01e71e253..7cefd065b 100644 --- a/docs/griptape-tools/official-tools/src/rag_client_1.py +++ b/docs/griptape-tools/official-tools/src/rag_tool_1.py @@ -4,7 +4,7 @@ from griptape.engines.rag.modules import PromptResponseRagModule, VectorStoreRetrievalRagModule from griptape.engines.rag.stages import ResponseRagStage, RetrievalRagStage from griptape.structures import Agent -from griptape.tools import RagClient +from griptape.tools import RagTool vector_store_driver = LocalVectorStoreDriver(embedding_driver=OpenAiEmbeddingDriver()) @@ -15,7 +15,7 @@ vector_store_driver.upsert_text_artifact(artifact=artifact, namespace="griptape") -rag_client = RagClient( +rag_tool = RagTool( description="Contains information about Griptape", off_prompt=False, rag_engine=RagEngine( @@ -32,6 +32,6 @@ ), ) -agent = Agent(tools=[rag_client]) +agent = Agent(tools=[rag_tool]) agent.run("what is Griptape?") diff --git a/docs/griptape-tools/official-tools/src/rest_api_client_1.py b/docs/griptape-tools/official-tools/src/rest_api_tool_1.py similarity index 98% rename from docs/griptape-tools/official-tools/src/rest_api_client_1.py rename to docs/griptape-tools/official-tools/src/rest_api_tool_1.py index 026874283..2093163b7 100644 --- a/docs/griptape-tools/official-tools/src/rest_api_client_1.py +++ b/docs/griptape-tools/official-tools/src/rest_api_tool_1.py @@ -5,13 +5,13 @@ from griptape.memory.structure import ConversationMemory from griptape.structures import Pipeline from griptape.tasks import ToolkitTask -from griptape.tools import RestApiClient +from griptape.tools import RestApiTool config.drivers = DriverConfig( prompt=OpenAiChatPromptDriver(model="gpt-4o", temperature=0.1), ) -posts_client = RestApiClient( +posts_client = RestApiTool( base_url="https://jsonplaceholder.typicode.com", path="posts", description="Allows for creating, updating, deleting, patching, and getting posts.", diff --git a/docs/griptape-tools/official-tools/src/sql_client_1.py b/docs/griptape-tools/official-tools/src/sql_tool_1.py similarity index 91% rename from docs/griptape-tools/official-tools/src/sql_client_1.py rename to docs/griptape-tools/official-tools/src/sql_tool_1.py index 3e89d6096..f7630891f 100644 --- a/docs/griptape-tools/official-tools/src/sql_client_1.py +++ b/docs/griptape-tools/official-tools/src/sql_tool_1.py @@ -5,7 +5,7 @@ from griptape.drivers import AmazonRedshiftSqlDriver from griptape.loaders import SqlLoader from griptape.structures import Agent -from griptape.tools import SqlClient +from griptape.tools import SqlTool session = boto3.Session() @@ -17,7 +17,7 @@ ) ) -sql_tool = SqlClient( +sql_tool = SqlTool( sql_loader=sql_loader, table_name="people", table_description="contains information about tech industry professionals", diff --git a/docs/griptape-tools/official-tools/src/structure_run_client_1.py b/docs/griptape-tools/official-tools/src/structure_run_tool_1.py similarity index 83% rename from docs/griptape-tools/official-tools/src/structure_run_client_1.py rename to docs/griptape-tools/official-tools/src/structure_run_tool_1.py index 10f48b80d..575092ce6 100644 --- a/docs/griptape-tools/official-tools/src/structure_run_client_1.py +++ b/docs/griptape-tools/official-tools/src/structure_run_tool_1.py @@ -2,13 +2,13 @@ from griptape.drivers import GriptapeCloudStructureRunDriver from griptape.structures import Agent -from griptape.tools import StructureRunClient +from griptape.tools import StructureRunTool base_url = os.environ["GRIPTAPE_CLOUD_BASE_URL"] api_key = os.environ["GRIPTAPE_CLOUD_API_KEY"] structure_id = os.environ["GRIPTAPE_CLOUD_STRUCTURE_ID"] -structure_run_tool = StructureRunClient( +structure_run_tool = StructureRunTool( description="RAG Expert Agent - Structure to invoke with natural language queries about the topic of Retrieval Augmented Generation", driver=GriptapeCloudStructureRunDriver( base_url=base_url, @@ -17,7 +17,7 @@ ), ) -# Set up an agent using the StructureRunClient tool +# Set up an agent using the StructureRunTool tool agent = Agent(tools=[structure_run_tool]) # Task: Ask the Griptape Cloud Hosted Structure about modular RAG diff --git a/docs/griptape-tools/official-tools/src/task_memory_client_1.py b/docs/griptape-tools/official-tools/src/task_memory_client_1.py deleted file mode 100644 index e9c2562a1..000000000 --- a/docs/griptape-tools/official-tools/src/task_memory_client_1.py +++ /dev/null @@ -1,4 +0,0 @@ -from griptape.structures import Agent -from griptape.tools import TaskMemoryClient, WebScraper - -Agent(tools=[WebScraper(off_prompt=True), TaskMemoryClient(off_prompt=False)]) diff --git a/docs/griptape-tools/official-tools/src/task_memory_tool_1.py b/docs/griptape-tools/official-tools/src/task_memory_tool_1.py new file mode 100644 index 000000000..f5c2c487f --- /dev/null +++ b/docs/griptape-tools/official-tools/src/task_memory_tool_1.py @@ -0,0 +1,4 @@ +from griptape.structures import Agent +from griptape.tools import TaskMemoryTool, WebScraperTool + +Agent(tools=[WebScraperTool(off_prompt=True), TaskMemoryTool(off_prompt=False)]) diff --git a/docs/griptape-tools/official-tools/src/text_to_speech_client_1.py b/docs/griptape-tools/official-tools/src/text_to_speech_tool_1.py similarity index 81% rename from docs/griptape-tools/official-tools/src/text_to_speech_client_1.py rename to docs/griptape-tools/official-tools/src/text_to_speech_tool_1.py index c6a03b80d..376113d63 100644 --- a/docs/griptape-tools/official-tools/src/text_to_speech_client_1.py +++ b/docs/griptape-tools/official-tools/src/text_to_speech_tool_1.py @@ -3,7 +3,7 @@ from griptape.drivers import ElevenLabsTextToSpeechDriver from griptape.engines import TextToSpeechEngine from griptape.structures import Agent -from griptape.tools.text_to_speech_client.tool import TextToSpeechClient +from griptape.tools.text_to_speech.tool import TextToSpeechTool driver = ElevenLabsTextToSpeechDriver( api_key=os.environ["ELEVEN_LABS_API_KEY"], @@ -11,7 +11,7 @@ voice="Matilda", ) -tool = TextToSpeechClient( +tool = TextToSpeechTool( engine=TextToSpeechEngine( text_to_speech_driver=driver, ), diff --git a/docs/griptape-tools/official-tools/src/variation_image_generation_client_1.py b/docs/griptape-tools/official-tools/src/variation_image_generation_tool_1.py similarity index 90% rename from docs/griptape-tools/official-tools/src/variation_image_generation_client_1.py rename to docs/griptape-tools/official-tools/src/variation_image_generation_tool_1.py index 6c4432d52..209d97a7b 100644 --- a/docs/griptape-tools/official-tools/src/variation_image_generation_client_1.py +++ b/docs/griptape-tools/official-tools/src/variation_image_generation_tool_1.py @@ -1,7 +1,7 @@ from griptape.drivers import AmazonBedrockImageGenerationDriver, BedrockStableDiffusionImageGenerationModelDriver from griptape.engines import VariationImageGenerationEngine from griptape.structures import Agent -from griptape.tools import VariationImageGenerationClient +from griptape.tools import VariationImageGenerationTool # Create a driver configured to use Stable Diffusion via Bedrock. driver = AmazonBedrockImageGenerationDriver( @@ -17,7 +17,7 @@ ) # Create a tool configured to use the engine. -tool = VariationImageGenerationClient( +tool = VariationImageGenerationTool( engine=engine, ) diff --git a/docs/griptape-tools/official-tools/src/variation_image_generation_client_2.py b/docs/griptape-tools/official-tools/src/variation_image_generation_tool_2.py similarity index 89% rename from docs/griptape-tools/official-tools/src/variation_image_generation_client_2.py rename to docs/griptape-tools/official-tools/src/variation_image_generation_tool_2.py index d98aec199..036b75d48 100644 --- a/docs/griptape-tools/official-tools/src/variation_image_generation_client_2.py +++ b/docs/griptape-tools/official-tools/src/variation_image_generation_tool_2.py @@ -1,7 +1,7 @@ from griptape.drivers import AmazonBedrockImageGenerationDriver, BedrockStableDiffusionImageGenerationModelDriver from griptape.engines import PromptImageGenerationEngine, VariationImageGenerationEngine from griptape.structures import Agent -from griptape.tools import PromptImageGenerationClient, VariationImageGenerationClient +from griptape.tools import PromptImageGenerationTool, VariationImageGenerationTool # Create a driver configured to use Stable Diffusion via Bedrock. driver = AmazonBedrockImageGenerationDriver( @@ -17,7 +17,7 @@ ) # Create a prompt image generation client configured to use the engine. -prompt_tool = PromptImageGenerationClient( +prompt_tool = PromptImageGenerationTool( engine=prompt_engine, ) @@ -27,7 +27,7 @@ ) # Create a variation image generation client configured to use the engine. -variation_tool = VariationImageGenerationClient( +variation_tool = VariationImageGenerationTool( engine=variation_engine, ) diff --git a/docs/griptape-tools/official-tools/src/vector_store_client_1.py b/docs/griptape-tools/official-tools/src/vector_store_tool_1.py similarity index 81% rename from docs/griptape-tools/official-tools/src/vector_store_client_1.py rename to docs/griptape-tools/official-tools/src/vector_store_tool_1.py index df9117960..57ca7b25b 100644 --- a/docs/griptape-tools/official-tools/src/vector_store_client_1.py +++ b/docs/griptape-tools/official-tools/src/vector_store_tool_1.py @@ -2,7 +2,7 @@ from griptape.drivers import LocalVectorStoreDriver, OpenAiEmbeddingDriver from griptape.loaders import WebLoader from griptape.structures import Agent -from griptape.tools import TaskMemoryClient, VectorStoreClient +from griptape.tools import TaskMemoryTool, VectorStoreTool vector_store_driver = LocalVectorStoreDriver( embedding_driver=OpenAiEmbeddingDriver(), @@ -13,13 +13,13 @@ raise Exception(artifacts.value) vector_store_driver.upsert_text_artifacts({"griptape": artifacts}) -vector_db = VectorStoreClient( +vector_db = VectorStoreTool( description="This DB has information about the Griptape Python framework", vector_store_driver=vector_store_driver, query_params={"namespace": "griptape"}, off_prompt=True, ) -agent = Agent(tools=[vector_db, TaskMemoryClient(off_prompt=False)]) +agent = Agent(tools=[vector_db, TaskMemoryTool(off_prompt=False)]) agent.run("what is Griptape?") diff --git a/docs/griptape-tools/official-tools/src/web_scraper_1.py b/docs/griptape-tools/official-tools/src/web_scraper_1.py deleted file mode 100644 index 138e8600f..000000000 --- a/docs/griptape-tools/official-tools/src/web_scraper_1.py +++ /dev/null @@ -1,6 +0,0 @@ -from griptape.structures import Agent -from griptape.tools import TaskMemoryClient, WebScraper - -agent = Agent(tools=[WebScraper(off_prompt=True), TaskMemoryClient(off_prompt=False)]) - -agent.run("Based on https://www.griptape.ai/, tell me what griptape is") diff --git a/docs/griptape-tools/official-tools/src/web_scraper_tool_1.py b/docs/griptape-tools/official-tools/src/web_scraper_tool_1.py new file mode 100644 index 000000000..7716acde4 --- /dev/null +++ b/docs/griptape-tools/official-tools/src/web_scraper_tool_1.py @@ -0,0 +1,6 @@ +from griptape.structures import Agent +from griptape.tools import TaskMemoryTool, WebScraperTool + +agent = Agent(tools=[WebScraperTool(off_prompt=True), TaskMemoryTool(off_prompt=False)]) + +agent.run("Based on https://www.griptape.ai/, tell me what griptape is") diff --git a/docs/griptape-tools/official-tools/src/web_search_1.py b/docs/griptape-tools/official-tools/src/web_search_tool_1.py similarity index 71% rename from docs/griptape-tools/official-tools/src/web_search_1.py rename to docs/griptape-tools/official-tools/src/web_search_tool_1.py index 70603a693..3469ad7f9 100644 --- a/docs/griptape-tools/official-tools/src/web_search_1.py +++ b/docs/griptape-tools/official-tools/src/web_search_tool_1.py @@ -2,10 +2,10 @@ from griptape.drivers import GoogleWebSearchDriver from griptape.structures import Agent -from griptape.tools import WebSearch +from griptape.tools import WebSearchTool -# Initialize the WebSearch tool with necessary parameters -web_search_tool = WebSearch( +# Initialize the WebSearchTool tool with necessary parameters +web_search_tool = WebSearchTool( web_search_driver=GoogleWebSearchDriver( api_key=os.environ["GOOGLE_API_KEY"], search_id=os.environ["GOOGLE_API_SEARCH_ID"], @@ -15,7 +15,7 @@ ), ) -# Set up an agent using the WebSearch tool +# Set up an agent using the WebSearchTool tool agent = Agent(tools=[web_search_tool]) # Task: Search the web for a specific query diff --git a/docs/griptape-tools/official-tools/src/web_search_2.py b/docs/griptape-tools/official-tools/src/web_search_tool_2.py similarity index 91% rename from docs/griptape-tools/official-tools/src/web_search_2.py rename to docs/griptape-tools/official-tools/src/web_search_tool_2.py index b40eac094..dd9c32655 100644 --- a/docs/griptape-tools/official-tools/src/web_search_2.py +++ b/docs/griptape-tools/official-tools/src/web_search_tool_2.py @@ -4,11 +4,11 @@ from griptape.drivers import GoogleWebSearchDriver from griptape.structures import Agent -from griptape.tools import WebSearch +from griptape.tools import WebSearchTool agent = Agent( tools=[ - WebSearch( + WebSearchTool( web_search_driver=GoogleWebSearchDriver( api_key=os.environ["GOOGLE_API_KEY"], search_id=os.environ["GOOGLE_API_SEARCH_ID"], diff --git a/docs/griptape-tools/official-tools/structure-run-client.md b/docs/griptape-tools/official-tools/structure-run-tool.md similarity index 90% rename from docs/griptape-tools/official-tools/structure-run-client.md rename to docs/griptape-tools/official-tools/structure-run-tool.md index 139633059..7b73e5b52 100644 --- a/docs/griptape-tools/official-tools/structure-run-client.md +++ b/docs/griptape-tools/official-tools/structure-run-tool.md @@ -1,20 +1,20 @@ -# StructureRunClient +# Structure Run Tool -The StructureRunClient Tool provides a way to run Structures via a Tool. +The [StructureRunTool](../../reference/griptape/tools/structure_run/tool.md) Tool provides a way to run Structures via a Tool. It requires you to provide a [Structure Run Driver](../../griptape-framework/drivers/structure-run-drivers.md) to run the Structure in the desired environment. ```python ---8<-- "docs/griptape-tools/official-tools/src/structure_run_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/structure_run_tool_1.py" ``` ``` [05/02/24 13:50:03] INFO ToolkitTask 4e9458375bda4fbcadb77a94624ed64c Input: what is modular RAG? [05/02/24 13:50:10] INFO Subtask 5ef2d72028fc495aa7faf6f46825b004 - Thought: To answer this question, I need to run a search for the term "modular RAG". I will use the StructureRunClient action to execute a + Thought: To answer this question, I need to run a search for the term "modular RAG". I will use the StructureRunTool action to execute a search structure. Actions: [ { - "name": "StructureRunClient", + "name": "StructureRunTool", "path": "run_structure", "input": { "values": { diff --git a/docs/griptape-tools/official-tools/task-memory-client.md b/docs/griptape-tools/official-tools/task-memory-tool.md similarity index 74% rename from docs/griptape-tools/official-tools/task-memory-client.md rename to docs/griptape-tools/official-tools/task-memory-tool.md index fa88c85b9..a988c3a64 100644 --- a/docs/griptape-tools/official-tools/task-memory-client.md +++ b/docs/griptape-tools/official-tools/task-memory-tool.md @@ -1,7 +1,7 @@ -# TaskMemoryClient +# Task Memory Tool Tool This tool enables LLMs to query and summarize task outputs that are stored in short-term tool memory. This tool uniquely requires the user to set the `off_prompt` property explicitly for usability reasons (Griptape doesn't provide the default `True` value). ```python ---8<-- "docs/griptape-tools/official-tools/src/task_memory_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/task_memory_tool_1.py" ``` diff --git a/docs/griptape-tools/official-tools/text-to-speech-client.md b/docs/griptape-tools/official-tools/text-to-speech-tool.md similarity index 72% rename from docs/griptape-tools/official-tools/text-to-speech-client.md rename to docs/griptape-tools/official-tools/text-to-speech-tool.md index d7fa043a7..ac3f54f8e 100644 --- a/docs/griptape-tools/official-tools/text-to-speech-client.md +++ b/docs/griptape-tools/official-tools/text-to-speech-tool.md @@ -1,7 +1,7 @@ -# TextToSpeechClient +# Text To Speech Tool This Tool enables LLMs to synthesize speech from text using [Text to Speech Engines](../../reference/griptape/engines/audio/text_to_speech_engine.md) and [Text to Speech Drivers](../../reference/griptape/drivers/text_to_speech/index.md). ```python ---8<-- "docs/griptape-tools/official-tools/src/text_to_speech_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/text_to_speech_tool_1.py" ``` diff --git a/docs/griptape-tools/official-tools/variation-image-generation-client.md b/docs/griptape-tools/official-tools/variation-image-generation-tool.md similarity index 83% rename from docs/griptape-tools/official-tools/variation-image-generation-client.md rename to docs/griptape-tools/official-tools/variation-image-generation-tool.md index 4b5880ef8..bcc8c3f61 100644 --- a/docs/griptape-tools/official-tools/variation-image-generation-client.md +++ b/docs/griptape-tools/official-tools/variation-image-generation-tool.md @@ -1,15 +1,15 @@ -# VariationImageGenerationEngine +# Variation Image Generation Engine Tool This Tool allows LLMs to generate variations of an input image from a text prompt. The input image can be provided either by its file path or by its [Task Memory](../../griptape-framework/structures/task-memory.md) reference. ## Referencing an Image by File Path ```python ---8<-- "docs/griptape-tools/official-tools/src/variation_image_generation_client_1.py" +--8<-- "docs/griptape-tools/official-tools/src/variation_image_generation_tool_1.py" ``` ## Referencing an Image in Task Memory ```python ---8<-- "docs/griptape-tools/official-tools/src/variation_image_generation_client_2.py" +--8<-- "docs/griptape-tools/official-tools/src/variation_image_generation_client_tool_2.py" ``` diff --git a/docs/griptape-tools/official-tools/vector-store-client.md b/docs/griptape-tools/official-tools/vector-store-client.md deleted file mode 100644 index 8fd280ec9..000000000 --- a/docs/griptape-tools/official-tools/vector-store-client.md +++ /dev/null @@ -1,7 +0,0 @@ -The [VectorStoreClient](../../reference/griptape/tools/vector_store_client/tool.md) enables LLMs to query vector stores. - -Here is an example of how it can be used with a local vector store driver: - -```python ---8<-- "docs/griptape-tools/official-tools/src/vector_store_client_1.py" -``` diff --git a/docs/griptape-tools/official-tools/vector-store-tool.md b/docs/griptape-tools/official-tools/vector-store-tool.md new file mode 100644 index 000000000..7317c25db --- /dev/null +++ b/docs/griptape-tools/official-tools/vector-store-tool.md @@ -0,0 +1,9 @@ +# Vector Store Tool + +The [VectorStoreTool](../../reference/griptape/tools/vector_store/tool.md) enables LLMs to query vector stores. + +Here is an example of how it can be used with a local vector store driver: + +```python +--8<-- "docs/griptape-tools/official-tools/src/vector_store_tool_1.py" +``` diff --git a/docs/griptape-tools/official-tools/web-scraper.md b/docs/griptape-tools/official-tools/web-scraper-tool.md similarity index 96% rename from docs/griptape-tools/official-tools/web-scraper.md rename to docs/griptape-tools/official-tools/web-scraper-tool.md index 5d8e1fe27..1261d955d 100644 --- a/docs/griptape-tools/official-tools/web-scraper.md +++ b/docs/griptape-tools/official-tools/web-scraper-tool.md @@ -1,9 +1,9 @@ -# WebScraper +# Web Scraper Tool This tool enables LLMs to scrape web pages for full text, summaries, authors, titles, and keywords. It can also execute search queries to answer specific questions about the page. This tool uses OpenAI APIs for some of its activities, so in order to use it provide a valid API key in `openai_api_key`. ```python ---8<-- "docs/griptape-tools/official-tools/src/web_scraper_1.py" +--8<-- "docs/griptape-tools/official-tools/src/web_scraper_tool_1.py" ``` ``` [09/11/23 15:27:39] INFO Task dd9ad12c5c1e4280a6e20d7c116303ed @@ -29,7 +29,7 @@ This tool enables LLMs to scrape web pages for full text, summaries, authors, ti in memory. I can use the TaskMemory tool with the summarize activity to get a summary of the content. - Action: {"name": "TaskMemoryClient", "path": + Action: {"name": "TaskMemoryTool", "path": "summarize", "input": {"values": {"memory_name": "TaskMemory", "artifact_namespace": "02da5930b8d74f7ca30aecc3760a3318"}}} diff --git a/docs/griptape-tools/official-tools/web-search.md b/docs/griptape-tools/official-tools/web-search-tool.md similarity index 97% rename from docs/griptape-tools/official-tools/web-search.md rename to docs/griptape-tools/official-tools/web-search-tool.md index 3d0495229..3f31fd4fd 100644 --- a/docs/griptape-tools/official-tools/web-search.md +++ b/docs/griptape-tools/official-tools/web-search-tool.md @@ -1,9 +1,9 @@ -# WebSearch +# Web Search Tool This tool enables LLMs to search the web. ```python ---8<-- "docs/griptape-tools/official-tools/src/web_search_1.py" +--8<-- "docs/griptape-tools/official-tools/src/web_search_tool_1.py" ``` ``` [09/08/23 15:37:25] INFO Task 2cf557f7f7cd4a20a7fa2f0c46af2f71 @@ -93,5 +93,5 @@ Extra schema properties can be added to the Tool to allow for more customization In this example, we add a `sort` property to the `search` Activity which will be added as a [Google custom search query parameter](https://developers.google.com/custom-search/v1/reference/rest/v1/cse/list). ```python ---8<-- "docs/griptape-tools/official-tools/src/web_search_2.py" +--8<-- "docs/griptape-tools/official-tools/src/web_search_tool_2.py" ``` diff --git a/griptape/tools/__init__.py b/griptape/tools/__init__.py index d99b63b6c..c33b9f0b0 100644 --- a/griptape/tools/__init__.py +++ b/griptape/tools/__init__.py @@ -1,67 +1,67 @@ from .base_tool import BaseTool -from .base_image_generation_client import BaseImageGenerationClient -from .calculator.tool import Calculator -from .web_search.tool import WebSearch -from .web_scraper.tool import WebScraper -from .sql_client.tool import SqlClient -from .email_client.tool import EmailClient -from .rest_api_client.tool import RestApiClient -from .file_manager.tool import FileManager -from .vector_store_client.tool import VectorStoreClient -from .date_time.tool import DateTime -from .task_memory_client.tool import TaskMemoryClient -from .base_aws_client import BaseAwsClient -from .aws_iam_client.tool import AwsIamClient -from .aws_s3_client.tool import AwsS3Client -from .computer.tool import Computer -from .base_google_client import BaseGoogleClient -from .google_gmail.tool import GoogleGmailClient -from .google_cal.tool import GoogleCalendarClient -from .google_docs.tool import GoogleDocsClient -from .google_drive.tool import GoogleDriveClient -from .openweather_client.tool import OpenWeatherClient -from .prompt_image_generation_client.tool import PromptImageGenerationClient -from .variation_image_generation_client.tool import VariationImageGenerationClient -from .inpainting_image_generation_client.tool import InpaintingImageGenerationClient -from .outpainting_image_generation_client.tool import OutpaintingImageGenerationClient -from .griptape_cloud_knowledge_base_client.tool import GriptapeCloudKnowledgeBaseClient -from .structure_run_client.tool import StructureRunClient -from .image_query_client.tool import ImageQueryClient -from .rag_client.tool import RagClient -from .text_to_speech_client.tool import TextToSpeechClient -from .audio_transcription_client.tool import AudioTranscriptionClient +from .base_image_generation_tool import BaseImageGenerationTool +from .calculator.tool import CalculatorTool +from .web_search.tool import WebSearchTool +from .web_scraper.tool import WebScraperTool +from .sql.tool import SqlTool +from .email.tool import EmailTool +from .rest_api.tool import RestApiTool +from .file_manager.tool import FileManagerTool +from .vector_store.tool import VectorStoreTool +from .date_time.tool import DateTimeTool +from .task_memory.tool import TaskMemoryTool +from .base_aws_tool import BaseAwsTool +from .aws_iam.tool import AwsIamTool +from .aws_s3.tool import AwsS3Tool +from .computer.tool import ComputerTool +from .base_google_tool import BaseGoogleTool +from .google_gmail.tool import GoogleGmailTool +from .google_calendar.tool import GoogleCalendarTool +from .google_docs.tool import GoogleDocsTool +from .google_drive.tool import GoogleDriveTool +from .openweather.tool import OpenWeatherTool +from .prompt_image_generation.tool import PromptImageGenerationTool +from .variation_image_generation.tool import VariationImageGenerationTool +from .inpainting_image_generation.tool import InpaintingImageGenerationTool +from .outpainting_image_generation.tool import OutpaintingImageGenerationTool +from .griptape_cloud_knowledge_base.tool import GriptapeCloudKnowledgeBaseTool +from .structure_run.tool import StructureRunTool +from .image_query.tool import ImageQueryTool +from .rag.tool import RagTool +from .text_to_speech.tool import TextToSpeechTool +from .audio_transcription.tool import AudioTranscriptionTool __all__ = [ "BaseTool", - "BaseImageGenerationClient", - "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", - "RagClient", - "TextToSpeechClient", - "AudioTranscriptionClient", + "BaseImageGenerationTool", + "BaseAwsTool", + "AwsIamTool", + "AwsS3Tool", + "BaseGoogleTool", + "GoogleGmailTool", + "GoogleDocsTool", + "GoogleCalendarTool", + "GoogleDriveTool", + "CalculatorTool", + "WebSearchTool", + "WebScraperTool", + "SqlTool", + "EmailTool", + "RestApiTool", + "FileManagerTool", + "VectorStoreTool", + "DateTimeTool", + "TaskMemoryTool", + "ComputerTool", + "OpenWeatherTool", + "PromptImageGenerationTool", + "VariationImageGenerationTool", + "InpaintingImageGenerationTool", + "OutpaintingImageGenerationTool", + "GriptapeCloudKnowledgeBaseTool", + "StructureRunTool", + "ImageQueryTool", + "RagTool", + "TextToSpeechTool", + "AudioTranscriptionTool", ] diff --git a/griptape/tools/audio_transcription_client/__init__.py b/griptape/tools/audio_transcription/__init__.py similarity index 100% rename from griptape/tools/audio_transcription_client/__init__.py rename to griptape/tools/audio_transcription/__init__.py diff --git a/griptape/tools/audio_transcription_client/manifest.yml b/griptape/tools/audio_transcription/manifest.yml similarity index 84% rename from griptape/tools/audio_transcription_client/manifest.yml rename to griptape/tools/audio_transcription/manifest.yml index 6bbe4a21a..32b017c55 100644 --- a/griptape/tools/audio_transcription_client/manifest.yml +++ b/griptape/tools/audio_transcription/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Transcription Client +name: Transcription Tool description: A tool for generating transcription of audio. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/audio_transcription_client/tool.py b/griptape/tools/audio_transcription/tool.py similarity index 98% rename from griptape/tools/audio_transcription_client/tool.py rename to griptape/tools/audio_transcription/tool.py index 62cd9e7a5..4174db209 100644 --- a/griptape/tools/audio_transcription_client/tool.py +++ b/griptape/tools/audio_transcription/tool.py @@ -17,7 +17,7 @@ @define -class AudioTranscriptionClient(BaseTool): +class AudioTranscriptionTool(BaseTool): """A tool that can be used to generate transcriptions from input audio.""" engine: AudioTranscriptionEngine = field(kw_only=True) diff --git a/griptape/tools/aws_iam_client/__init__.py b/griptape/tools/aws_iam/__init__.py similarity index 100% rename from griptape/tools/aws_iam_client/__init__.py rename to griptape/tools/aws_iam/__init__.py diff --git a/griptape/tools/aws_iam_client/manifest.yml b/griptape/tools/aws_iam/manifest.yml similarity index 86% rename from griptape/tools/aws_iam_client/manifest.yml rename to griptape/tools/aws_iam/manifest.yml index ea825527f..072d4f92e 100644 --- a/griptape/tools/aws_iam_client/manifest.yml +++ b/griptape/tools/aws_iam/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: AWS IAM Client +name: AWS IAM Tool description: Tool for the IAM boto3 API. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal \ No newline at end of file diff --git a/griptape/tools/aws_iam_client/tool.py b/griptape/tools/aws_iam/tool.py similarity index 97% rename from griptape/tools/aws_iam_client/tool.py rename to griptape/tools/aws_iam/tool.py index 1be0251f0..8d22dd3c9 100644 --- a/griptape/tools/aws_iam_client/tool.py +++ b/griptape/tools/aws_iam/tool.py @@ -6,7 +6,7 @@ from schema import Literal, Schema from griptape.artifacts import ErrorArtifact, ListArtifact, TextArtifact -from griptape.tools import BaseAwsClient +from griptape.tools import BaseAwsTool from griptape.utils.decorators import activity if TYPE_CHECKING: @@ -14,7 +14,7 @@ @define -class AwsIamClient(BaseAwsClient): +class AwsIamTool(BaseAwsTool): iam_client: Client = field(default=Factory(lambda self: self.session.client("iam"), takes_self=True), kw_only=True) @activity( diff --git a/griptape/tools/aws_s3_client/__init__.py b/griptape/tools/aws_s3/__init__.py similarity index 100% rename from griptape/tools/aws_s3_client/__init__.py rename to griptape/tools/aws_s3/__init__.py diff --git a/griptape/tools/aws_s3_client/manifest.yml b/griptape/tools/aws_s3/manifest.yml similarity index 86% rename from griptape/tools/aws_s3_client/manifest.yml rename to griptape/tools/aws_s3/manifest.yml index 642b6c588..a48169f0c 100644 --- a/griptape/tools/aws_s3_client/manifest.yml +++ b/griptape/tools/aws_s3/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: AWS S3 Client +name: AWS S3 Tool description: Tool for the S3 boto3 API. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal \ No newline at end of file diff --git a/griptape/tools/aws_s3_client/tool.py b/griptape/tools/aws_s3/tool.py similarity index 99% rename from griptape/tools/aws_s3_client/tool.py rename to griptape/tools/aws_s3/tool.py index 8f67195a1..24d091d71 100644 --- a/griptape/tools/aws_s3_client/tool.py +++ b/griptape/tools/aws_s3/tool.py @@ -7,7 +7,7 @@ from schema import Literal, Schema from griptape.artifacts import BlobArtifact, ErrorArtifact, InfoArtifact, ListArtifact, TextArtifact -from griptape.tools import BaseAwsClient +from griptape.tools import BaseAwsTool from griptape.utils.decorators import activity if TYPE_CHECKING: @@ -15,7 +15,7 @@ @define -class AwsS3Client(BaseAwsClient): +class AwsS3Tool(BaseAwsTool): s3_client: Client = field(default=Factory(lambda self: self.session.client("s3"), takes_self=True), kw_only=True) @activity( diff --git a/griptape/tools/base_aws_client.py b/griptape/tools/base_aws_tool.py similarity index 95% rename from griptape/tools/base_aws_client.py rename to griptape/tools/base_aws_tool.py index 8c6d02e2b..72fc54583 100644 --- a/griptape/tools/base_aws_client.py +++ b/griptape/tools/base_aws_tool.py @@ -14,7 +14,7 @@ @define -class BaseAwsClient(BaseTool, ABC): +class BaseAwsTool(BaseTool, ABC): session: boto3.Session = field(kw_only=True) @activity(config={"description": "Can be used to get current AWS account and IAM principal."}) diff --git a/griptape/tools/base_google_client.py b/griptape/tools/base_google_tool.py similarity index 98% rename from griptape/tools/base_google_client.py rename to griptape/tools/base_google_tool.py index 2a38d8ffe..c40a583cf 100644 --- a/griptape/tools/base_google_client.py +++ b/griptape/tools/base_google_tool.py @@ -9,7 +9,7 @@ @define -class BaseGoogleClient(BaseTool, ABC): +class BaseGoogleTool(BaseTool, ABC): DRIVE_FILE_SCOPES = ["https://www.googleapis.com/auth/drive.file"] DRIVE_AUTH_SCOPES = ["https://www.googleapis.com/auth/drive"] diff --git a/griptape/tools/base_griptape_cloud_client.py b/griptape/tools/base_griptape_cloud_tool.py similarity index 93% rename from griptape/tools/base_griptape_cloud_client.py rename to griptape/tools/base_griptape_cloud_tool.py index 4f5692957..7ee8f2dfc 100644 --- a/griptape/tools/base_griptape_cloud_client.py +++ b/griptape/tools/base_griptape_cloud_tool.py @@ -8,7 +8,7 @@ @define -class BaseGriptapeCloudClient(BaseTool, ABC): +class BaseGriptapeCloudTool(BaseTool, ABC): """Base class for Griptape Cloud clients. Attributes: diff --git a/griptape/tools/base_image_generation_client.py b/griptape/tools/base_image_generation_tool.py similarity index 88% rename from griptape/tools/base_image_generation_client.py rename to griptape/tools/base_image_generation_tool.py index e85336d23..487c6d1ba 100644 --- a/griptape/tools/base_image_generation_client.py +++ b/griptape/tools/base_image_generation_tool.py @@ -5,7 +5,7 @@ @define -class BaseImageGenerationClient(BlobArtifactFileOutputMixin, BaseTool): +class BaseImageGenerationTool(BlobArtifactFileOutputMixin, BaseTool): """A base class for tools that generate images from text prompts.""" PROMPT_DESCRIPTION = "Features and qualities to include in the generated image, descriptive and succinct." diff --git a/griptape/tools/calculator/manifest.yml b/griptape/tools/calculator/manifest.yml index 717313495..dd902c616 100644 --- a/griptape/tools/calculator/manifest.yml +++ b/griptape/tools/calculator/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Calculator +name: Calculator Tool description: Tool for making simple calculations in Python. contact_email: hello@griptape.ai -legal_info_url: https://www.griptape.ai/legal \ No newline at end of file +legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/calculator/tool.py b/griptape/tools/calculator/tool.py index e8fcb1ed4..ed128987f 100644 --- a/griptape/tools/calculator/tool.py +++ b/griptape/tools/calculator/tool.py @@ -5,7 +5,7 @@ from griptape.utils.decorators import activity -class Calculator(BaseTool): +class CalculatorTool(BaseTool): @activity( config={ "description": "Can be used for computing simple numerical or algebraic calculations in Python", diff --git a/griptape/tools/computer/manifest.yml b/griptape/tools/computer/manifest.yml index 706c32b5b..4c5d30495 100644 --- a/griptape/tools/computer/manifest.yml +++ b/griptape/tools/computer/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Computer +name: Computer Tool description: Tool that allows LLMs to run Python code and access the shell contact_email: hello@griptape.ai -legal_info_url: https://www.griptape.ai/legal \ No newline at end of file +legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/computer/tool.py b/griptape/tools/computer/tool.py index 4e996c63c..e2da2d9f8 100644 --- a/griptape/tools/computer/tool.py +++ b/griptape/tools/computer/tool.py @@ -23,7 +23,7 @@ @define -class Computer(BaseTool): +class ComputerTool(BaseTool): local_workdir: Optional[str] = field(default=None, kw_only=True) container_workdir: str = field(default="/griptape", kw_only=True) env_vars: dict = field(factory=dict, kw_only=True) diff --git a/griptape/tools/date_time/manifest.yml b/griptape/tools/date_time/manifest.yml index c50b46ed8..da8e553a5 100644 --- a/griptape/tools/date_time/manifest.yml +++ b/griptape/tools/date_time/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Date Time +name: Date Time Tool description: Tool that allows LLMs to retrieve the current date & time contact_email: hello@griptape.ai -legal_info_url: https://www.griptape.ai/legal \ No newline at end of file +legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/date_time/tool.py b/griptape/tools/date_time/tool.py index 728a3449a..5181dbe3e 100644 --- a/griptape/tools/date_time/tool.py +++ b/griptape/tools/date_time/tool.py @@ -7,7 +7,7 @@ from griptape.utils.decorators import activity -class DateTime(BaseTool): +class DateTimeTool(BaseTool): @activity(config={"description": "Can be used to return current date and time."}) def get_current_datetime(self, _: dict) -> BaseArtifact: try: diff --git a/griptape/tools/email_client/__init__.py b/griptape/tools/email/__init__.py similarity index 100% rename from griptape/tools/email_client/__init__.py rename to griptape/tools/email/__init__.py diff --git a/griptape/tools/email_client/manifest.yml b/griptape/tools/email/manifest.yml similarity index 87% rename from griptape/tools/email_client/manifest.yml rename to griptape/tools/email/manifest.yml index c1e04b226..08009292d 100644 --- a/griptape/tools/email_client/manifest.yml +++ b/griptape/tools/email/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Email Client +name: Email Tool description: Tool for working with email. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal \ No newline at end of file diff --git a/griptape/tools/email_client/tool.py b/griptape/tools/email/tool.py similarity index 99% rename from griptape/tools/email_client/tool.py rename to griptape/tools/email/tool.py index 26c13bb9f..f5e7f0247 100644 --- a/griptape/tools/email_client/tool.py +++ b/griptape/tools/email/tool.py @@ -16,7 +16,7 @@ @define -class EmailClient(BaseTool): +class EmailTool(BaseTool): """Tool for working with email. Attributes: diff --git a/griptape/tools/file_manager/manifest.yml b/griptape/tools/file_manager/manifest.yml index 8778098fb..132a03327 100644 --- a/griptape/tools/file_manager/manifest.yml +++ b/griptape/tools/file_manager/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: File Manager +name: File Manager Tool description: Tool for managing files in the local environment. contact_email: hello@griptape.ai -legal_info_url: https://www.griptape.ai/legal \ No newline at end of file +legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/file_manager/tool.py b/griptape/tools/file_manager/tool.py index c0cb691ea..a3e17a8c4 100644 --- a/griptape/tools/file_manager/tool.py +++ b/griptape/tools/file_manager/tool.py @@ -12,8 +12,8 @@ @define -class FileManager(BaseTool): - """FileManager is a tool that can be used to list, load, and save files. +class FileManagerTool(BaseTool): + """FileManagerTool is a tool that can be used to list, load, and save files. Attributes: file_manager_driver: File Manager Driver to use to list, load, and save files. diff --git a/griptape/tools/google_cal/__init__.py b/griptape/tools/google_calendar/__init__.py similarity index 100% rename from griptape/tools/google_cal/__init__.py rename to griptape/tools/google_calendar/__init__.py diff --git a/griptape/tools/google_cal/manifest.yml b/griptape/tools/google_calendar/manifest.yml similarity index 100% rename from griptape/tools/google_cal/manifest.yml rename to griptape/tools/google_calendar/manifest.yml diff --git a/griptape/tools/google_cal/requirements.txt b/griptape/tools/google_calendar/requirements.txt similarity index 100% rename from griptape/tools/google_cal/requirements.txt rename to griptape/tools/google_calendar/requirements.txt diff --git a/griptape/tools/google_cal/tool.py b/griptape/tools/google_calendar/tool.py similarity index 98% rename from griptape/tools/google_cal/tool.py rename to griptape/tools/google_calendar/tool.py index 70f685605..de9c4e8e1 100644 --- a/griptape/tools/google_cal/tool.py +++ b/griptape/tools/google_calendar/tool.py @@ -7,12 +7,12 @@ from schema import Literal, Optional, Schema from griptape.artifacts import ErrorArtifact, InfoArtifact, ListArtifact, TextArtifact -from griptape.tools import BaseGoogleClient +from griptape.tools import BaseGoogleTool from griptape.utils.decorators import activity @define -class GoogleCalendarClient(BaseGoogleClient): +class GoogleCalendarTool(BaseGoogleTool): CREATE_EVENT_SCOPES = ["https://www.googleapis.com/auth/calendar"] GET_UPCOMING_EVENTS_SCOPES = ["https://www.googleapis.com/auth/calendar"] diff --git a/griptape/tools/google_docs/tool.py b/griptape/tools/google_docs/tool.py index b3564b9b2..be40b09da 100644 --- a/griptape/tools/google_docs/tool.py +++ b/griptape/tools/google_docs/tool.py @@ -6,12 +6,12 @@ from schema import Literal, Optional, Schema from griptape.artifacts import ErrorArtifact, InfoArtifact -from griptape.tools import BaseGoogleClient +from griptape.tools import BaseGoogleTool from griptape.utils.decorators import activity @define -class GoogleDocsClient(BaseGoogleClient): +class GoogleDocsTool(BaseGoogleTool): DOCS_SCOPES = ["https://www.googleapis.com/auth/documents"] DEFAULT_FOLDER_PATH = "root" diff --git a/griptape/tools/google_drive/tool.py b/griptape/tools/google_drive/tool.py index 37122a56b..1642ebaf7 100644 --- a/griptape/tools/google_drive/tool.py +++ b/griptape/tools/google_drive/tool.py @@ -9,12 +9,12 @@ from schema import Literal, Or, Schema from griptape.artifacts import BlobArtifact, ErrorArtifact, InfoArtifact, ListArtifact, TextArtifact -from griptape.tools import BaseGoogleClient +from griptape.tools import BaseGoogleTool from griptape.utils.decorators import activity @define -class GoogleDriveClient(BaseGoogleClient): +class GoogleDriveTool(BaseGoogleTool): LIST_FILES_SCOPES = ["https://www.googleapis.com/auth/drive.readonly"] GOOGLE_EXPORT_MIME_MAPPING = { diff --git a/griptape/tools/google_gmail/manifest.yml b/griptape/tools/google_gmail/manifest.yml index 262e3a6f8..869575166 100644 --- a/griptape/tools/google_gmail/manifest.yml +++ b/griptape/tools/google_gmail/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Google Gmail Client +name: Google Gmail Tool description: Tool for working with Google Gmail. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal \ No newline at end of file diff --git a/griptape/tools/google_gmail/tool.py b/griptape/tools/google_gmail/tool.py index 853b8850f..2cc959168 100644 --- a/griptape/tools/google_gmail/tool.py +++ b/griptape/tools/google_gmail/tool.py @@ -8,12 +8,12 @@ from schema import Literal, Schema from griptape.artifacts import ErrorArtifact, InfoArtifact -from griptape.tools import BaseGoogleClient +from griptape.tools import BaseGoogleTool from griptape.utils.decorators import activity @define -class GoogleGmailClient(BaseGoogleClient): +class GoogleGmailTool(BaseGoogleTool): CREATE_DRAFT_EMAIL_SCOPES = ["https://www.googleapis.com/auth/gmail.compose"] owner_email: str = field(kw_only=True) diff --git a/griptape/tools/griptape_cloud_knowledge_base_client/__init__.py b/griptape/tools/griptape_cloud_knowledge_base/__init__.py similarity index 100% rename from griptape/tools/griptape_cloud_knowledge_base_client/__init__.py rename to griptape/tools/griptape_cloud_knowledge_base/__init__.py diff --git a/griptape/tools/griptape_cloud_knowledge_base_client/manifest.yml b/griptape/tools/griptape_cloud_knowledge_base/manifest.yml similarity index 78% rename from griptape/tools/griptape_cloud_knowledge_base_client/manifest.yml rename to griptape/tools/griptape_cloud_knowledge_base/manifest.yml index 89b7d2fe3..7262964c3 100644 --- a/griptape/tools/griptape_cloud_knowledge_base_client/manifest.yml +++ b/griptape/tools/griptape_cloud_knowledge_base/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Griptape Cloud Knowledge Base Client +name: Griptape Cloud Knowledge Base Tool description: Tool for using the Griptape Cloud Knowledge Base API. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/griptape_cloud_knowledge_base_client/tool.py b/griptape/tools/griptape_cloud_knowledge_base/tool.py similarity index 91% rename from griptape/tools/griptape_cloud_knowledge_base_client/tool.py rename to griptape/tools/griptape_cloud_knowledge_base/tool.py index 0c544524d..13ff76baa 100644 --- a/griptape/tools/griptape_cloud_knowledge_base_client/tool.py +++ b/griptape/tools/griptape_cloud_knowledge_base/tool.py @@ -7,12 +7,12 @@ from schema import Literal, Schema from griptape.artifacts import ErrorArtifact, TextArtifact -from griptape.tools.base_griptape_cloud_client import BaseGriptapeCloudClient +from griptape.tools.base_griptape_cloud_tool import BaseGriptapeCloudTool from griptape.utils.decorators import activity @define -class GriptapeCloudKnowledgeBaseClient(BaseGriptapeCloudClient): +class GriptapeCloudKnowledgeBaseTool(BaseGriptapeCloudTool): """Tool for querying a Griptape Cloud Knowledge Base. Attributes: @@ -64,7 +64,7 @@ def _get_knowledge_base_description(self) -> str: return response_body["description"] else: raise ValueError( - f"No description found for Knowledge Base {self.knowledge_base_id}. Please set a description, or manually set the `GriptapeCloudKnowledgeBaseClient.description` attribute.", + f"No description found for Knowledge Base {self.knowledge_base_id}. Please set a description, or manually set the `GriptapeCloudKnowledgeBaseTool.description` attribute.", ) else: raise ValueError(f"Error accessing Knowledge Base {self.knowledge_base_id}.") diff --git a/griptape/tools/image_query_client/__init__.py b/griptape/tools/image_query/__init__.py similarity index 100% rename from griptape/tools/image_query_client/__init__.py rename to griptape/tools/image_query/__init__.py diff --git a/griptape/tools/image_query_client/manifest.yml b/griptape/tools/image_query/manifest.yml similarity index 86% rename from griptape/tools/image_query_client/manifest.yml rename to griptape/tools/image_query/manifest.yml index b73027f6a..504543fca 100644 --- a/griptape/tools/image_query_client/manifest.yml +++ b/griptape/tools/image_query/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Image Query Client +name: Image Query Tool description: Tool for executing a natural language query on images. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/image_query_client/tool.py b/griptape/tools/image_query/tool.py similarity index 99% rename from griptape/tools/image_query_client/tool.py rename to griptape/tools/image_query/tool.py index a10929b13..97772d546 100644 --- a/griptape/tools/image_query_client/tool.py +++ b/griptape/tools/image_query/tool.py @@ -17,7 +17,7 @@ @define -class ImageQueryClient(BaseTool): +class ImageQueryTool(BaseTool): image_query_engine: ImageQueryEngine = field(kw_only=True) image_loader: ImageLoader = field(default=Factory(lambda: ImageLoader()), kw_only=True) diff --git a/griptape/tools/inpainting_image_generation_client/__init__.py b/griptape/tools/inpainting_image_generation/__init__.py similarity index 100% rename from griptape/tools/inpainting_image_generation_client/__init__.py rename to griptape/tools/inpainting_image_generation/__init__.py diff --git a/griptape/tools/inpainting_image_generation_client/manifest.yml b/griptape/tools/inpainting_image_generation/manifest.yml similarity index 79% rename from griptape/tools/inpainting_image_generation_client/manifest.yml rename to griptape/tools/inpainting_image_generation/manifest.yml index 575c0630d..d6592b741 100644 --- a/griptape/tools/inpainting_image_generation_client/manifest.yml +++ b/griptape/tools/inpainting_image_generation/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Inpainting Image Generation Client +name: Inpainting Image Generation Tool description: Tool for generating images through image inpainting. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/inpainting_image_generation_client/requirements.txt b/griptape/tools/inpainting_image_generation/requirements.txt similarity index 100% rename from griptape/tools/inpainting_image_generation_client/requirements.txt rename to griptape/tools/inpainting_image_generation/requirements.txt diff --git a/griptape/tools/inpainting_image_generation_client/tool.py b/griptape/tools/inpainting_image_generation/tool.py similarity index 93% rename from griptape/tools/inpainting_image_generation_client/tool.py rename to griptape/tools/inpainting_image_generation/tool.py index e8979efb0..d32f481d9 100644 --- a/griptape/tools/inpainting_image_generation_client/tool.py +++ b/griptape/tools/inpainting_image_generation/tool.py @@ -8,7 +8,7 @@ from griptape.artifacts import ErrorArtifact, ImageArtifact from griptape.loaders import ImageLoader -from griptape.tools.base_image_generation_client import BaseImageGenerationClient +from griptape.tools.base_image_generation_tool import BaseImageGenerationTool from griptape.utils.decorators import activity from griptape.utils.load_artifact_from_memory import load_artifact_from_memory @@ -17,7 +17,7 @@ @define -class InpaintingImageGenerationClient(BaseImageGenerationClient): +class InpaintingImageGenerationTool(BaseImageGenerationTool): """A tool that can be used to generate prompted inpaintings of an image. Attributes: @@ -34,8 +34,8 @@ class InpaintingImageGenerationClient(BaseImageGenerationClient): "description": "Modifies an image within a specified mask area using image and mask files.", "schema": Schema( { - Literal("prompt", description=BaseImageGenerationClient.PROMPT_DESCRIPTION): str, - Literal("negative_prompt", description=BaseImageGenerationClient.NEGATIVE_PROMPT_DESCRIPTION): str, + Literal("prompt", description=BaseImageGenerationTool.PROMPT_DESCRIPTION): str, + Literal("negative_prompt", description=BaseImageGenerationTool.NEGATIVE_PROMPT_DESCRIPTION): str, Literal( "image_file", description="The path to an image file to be used as a base to generate variations from.", @@ -63,8 +63,8 @@ def image_inpainting_from_file(self, params: dict[str, dict[str, str]]) -> Image "description": "Modifies an image within a specified mask area using image and mask artifacts in memory.", "schema": Schema( { - Literal("prompt", description=BaseImageGenerationClient.PROMPT_DESCRIPTION): str, - Literal("negative_prompt", description=BaseImageGenerationClient.NEGATIVE_PROMPT_DESCRIPTION): str, + Literal("prompt", description=BaseImageGenerationTool.PROMPT_DESCRIPTION): str, + Literal("negative_prompt", description=BaseImageGenerationTool.NEGATIVE_PROMPT_DESCRIPTION): str, "memory_name": str, "image_artifact_namespace": str, "image_artifact_name": str, diff --git a/griptape/tools/openweather_client/__init__.py b/griptape/tools/openweather/__init__.py similarity index 100% rename from griptape/tools/openweather_client/__init__.py rename to griptape/tools/openweather/__init__.py diff --git a/griptape/tools/openweather_client/manifest.yml b/griptape/tools/openweather/manifest.yml similarity index 86% rename from griptape/tools/openweather_client/manifest.yml rename to griptape/tools/openweather/manifest.yml index 66efae262..315143ea2 100644 --- a/griptape/tools/openweather_client/manifest.yml +++ b/griptape/tools/openweather/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: OpenWeather Client +name: OpenWeather Tool description: Tool for using OpenWeather to retrieve weather information contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/openweather_client/tool.py b/griptape/tools/openweather/tool.py similarity index 99% rename from griptape/tools/openweather_client/tool.py rename to griptape/tools/openweather/tool.py index 4a7edb0f6..311db733b 100644 --- a/griptape/tools/openweather_client/tool.py +++ b/griptape/tools/openweather/tool.py @@ -13,7 +13,7 @@ @define -class OpenWeatherClient(BaseTool): +class OpenWeatherTool(BaseTool): BASE_URL = "https://api.openweathermap.org/data/3.0/onecall" GEOCODING_URL = "https://api.openweathermap.org/geo/1.0/direct" US_STATE_CODES = [ diff --git a/griptape/tools/outpainting_image_generation_client/__init__.py b/griptape/tools/outpainting_image_generation/__init__.py similarity index 100% rename from griptape/tools/outpainting_image_generation_client/__init__.py rename to griptape/tools/outpainting_image_generation/__init__.py diff --git a/griptape/tools/outpainting_image_generation_client/manifest.yml b/griptape/tools/outpainting_image_generation/manifest.yml similarity index 79% rename from griptape/tools/outpainting_image_generation_client/manifest.yml rename to griptape/tools/outpainting_image_generation/manifest.yml index 54c84668e..8b7ca14a1 100644 --- a/griptape/tools/outpainting_image_generation_client/manifest.yml +++ b/griptape/tools/outpainting_image_generation/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Outpainting Image Generation Client +name: Outpainting Image Generation Tool description: Tool for generating images through image outpainting. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/outpainting_image_generation_client/requirements.txt b/griptape/tools/outpainting_image_generation/requirements.txt similarity index 100% rename from griptape/tools/outpainting_image_generation_client/requirements.txt rename to griptape/tools/outpainting_image_generation/requirements.txt diff --git a/griptape/tools/outpainting_image_generation_client/tool.py b/griptape/tools/outpainting_image_generation/tool.py similarity index 93% rename from griptape/tools/outpainting_image_generation_client/tool.py rename to griptape/tools/outpainting_image_generation/tool.py index 800d88e70..afa39e178 100644 --- a/griptape/tools/outpainting_image_generation_client/tool.py +++ b/griptape/tools/outpainting_image_generation/tool.py @@ -8,7 +8,7 @@ from griptape.artifacts import ErrorArtifact, ImageArtifact from griptape.loaders import ImageLoader -from griptape.tools import BaseImageGenerationClient +from griptape.tools import BaseImageGenerationTool from griptape.utils.decorators import activity from griptape.utils.load_artifact_from_memory import load_artifact_from_memory @@ -17,7 +17,7 @@ @define -class OutpaintingImageGenerationClient(BaseImageGenerationClient): +class OutpaintingImageGenerationTool(BaseImageGenerationTool): """A tool that can be used to generate prompted outpaintings of an image. Attributes: @@ -34,8 +34,8 @@ class OutpaintingImageGenerationClient(BaseImageGenerationClient): "description": "Modifies an image outside a specified mask area using image and mask files.", "schema": Schema( { - Literal("prompt", description=BaseImageGenerationClient.PROMPT_DESCRIPTION): str, - Literal("negative_prompt", description=BaseImageGenerationClient.NEGATIVE_PROMPT_DESCRIPTION): str, + Literal("prompt", description=BaseImageGenerationTool.PROMPT_DESCRIPTION): str, + Literal("negative_prompt", description=BaseImageGenerationTool.NEGATIVE_PROMPT_DESCRIPTION): str, Literal( "image_file", description="The path to an image file to be used as a base to generate variations from.", @@ -61,8 +61,8 @@ def image_outpainting_from_file(self, params: dict[str, dict[str, str]]) -> Imag "description": "Modifies an image outside a specified mask area using image and mask artifacts in memory.", "schema": Schema( { - Literal("prompt", description=BaseImageGenerationClient.PROMPT_DESCRIPTION): str, - Literal("negative_prompt", description=BaseImageGenerationClient.NEGATIVE_PROMPT_DESCRIPTION): str, + Literal("prompt", description=BaseImageGenerationTool.PROMPT_DESCRIPTION): str, + Literal("negative_prompt", description=BaseImageGenerationTool.NEGATIVE_PROMPT_DESCRIPTION): str, "memory_name": str, "image_artifact_namespace": str, "mask_artifact_namespace": str, diff --git a/griptape/tools/prompt_image_generation_client/__init__.py b/griptape/tools/prompt_image_generation/__init__.py similarity index 100% rename from griptape/tools/prompt_image_generation_client/__init__.py rename to griptape/tools/prompt_image_generation/__init__.py diff --git a/griptape/tools/prompt_image_generation_client/manifest.yml b/griptape/tools/prompt_image_generation/manifest.yml similarity index 80% rename from griptape/tools/prompt_image_generation_client/manifest.yml rename to griptape/tools/prompt_image_generation/manifest.yml index 665a24444..091cc14d7 100644 --- a/griptape/tools/prompt_image_generation_client/manifest.yml +++ b/griptape/tools/prompt_image_generation/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Prompt Image Generation Client +name: Prompt Image Generation Tool description: Tool for generating images from text prompts. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/prompt_image_generation_client/requirements.txt b/griptape/tools/prompt_image_generation/requirements.txt similarity index 100% rename from griptape/tools/prompt_image_generation_client/requirements.txt rename to griptape/tools/prompt_image_generation/requirements.txt diff --git a/griptape/tools/prompt_image_generation_client/tool.py b/griptape/tools/prompt_image_generation/tool.py similarity index 87% rename from griptape/tools/prompt_image_generation_client/tool.py rename to griptape/tools/prompt_image_generation/tool.py index 771b4e41d..6cd6ac560 100644 --- a/griptape/tools/prompt_image_generation_client/tool.py +++ b/griptape/tools/prompt_image_generation/tool.py @@ -5,7 +5,7 @@ from attrs import define, field from schema import Literal, Schema -from griptape.tools import BaseImageGenerationClient +from griptape.tools import BaseImageGenerationTool from griptape.utils.decorators import activity if TYPE_CHECKING: @@ -14,7 +14,7 @@ @define -class PromptImageGenerationClient(BaseImageGenerationClient): +class PromptImageGenerationTool(BaseImageGenerationTool): """A tool that can be used to generate an image from a text prompt. Attributes: @@ -30,8 +30,8 @@ class PromptImageGenerationClient(BaseImageGenerationClient): "description": "Generates an image from text prompts.", "schema": Schema( { - Literal("prompt", description=BaseImageGenerationClient.PROMPT_DESCRIPTION): str, - Literal("negative_prompt", description=BaseImageGenerationClient.NEGATIVE_PROMPT_DESCRIPTION): str, + Literal("prompt", description=BaseImageGenerationTool.PROMPT_DESCRIPTION): str, + Literal("negative_prompt", description=BaseImageGenerationTool.NEGATIVE_PROMPT_DESCRIPTION): str, } ), }, diff --git a/griptape/tools/rag_client/__init__.py b/griptape/tools/rag/__init__.py similarity index 100% rename from griptape/tools/rag_client/__init__.py rename to griptape/tools/rag/__init__.py diff --git a/griptape/tools/rag_client/manifest.yml b/griptape/tools/rag/manifest.yml similarity index 88% rename from griptape/tools/rag_client/manifest.yml rename to griptape/tools/rag/manifest.yml index 86998feb4..7a3d49c65 100644 --- a/griptape/tools/rag_client/manifest.yml +++ b/griptape/tools/rag/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: RAG Client +name: RAG Tool description: Tool for querying RAG engines contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal \ No newline at end of file diff --git a/griptape/tools/rag_client/requirements.txt b/griptape/tools/rag/requirements.txt similarity index 100% rename from griptape/tools/rag_client/requirements.txt rename to griptape/tools/rag/requirements.txt diff --git a/griptape/tools/rag_client/tool.py b/griptape/tools/rag/tool.py similarity index 97% rename from griptape/tools/rag_client/tool.py rename to griptape/tools/rag/tool.py index 613e254af..8608493d1 100644 --- a/griptape/tools/rag_client/tool.py +++ b/griptape/tools/rag/tool.py @@ -14,7 +14,7 @@ @define(kw_only=True) -class RagClient(BaseTool): +class RagTool(BaseTool): """Tool for querying a RAG engine. Attributes: diff --git a/griptape/tools/rest_api_client/__init__.py b/griptape/tools/rest_api/__init__.py similarity index 100% rename from griptape/tools/rest_api_client/__init__.py rename to griptape/tools/rest_api/__init__.py diff --git a/griptape/tools/rest_api_client/manifest.yml b/griptape/tools/rest_api/manifest.yml similarity index 87% rename from griptape/tools/rest_api_client/manifest.yml rename to griptape/tools/rest_api/manifest.yml index 7a881d037..01816e483 100644 --- a/griptape/tools/rest_api_client/manifest.yml +++ b/griptape/tools/rest_api/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Rest Api +name: Rest Api Tool description: Tool for calling rest apis. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/rest_api_client/tool.py b/griptape/tools/rest_api/tool.py similarity index 99% rename from griptape/tools/rest_api_client/tool.py rename to griptape/tools/rest_api/tool.py index b27beda0e..24ab4c93e 100644 --- a/griptape/tools/rest_api_client/tool.py +++ b/griptape/tools/rest_api/tool.py @@ -14,7 +14,7 @@ @define -class RestApiClient(BaseTool): +class RestApiTool(BaseTool): """A tool for making REST API requests. Attributes: diff --git a/griptape/tools/sql_client/__init__.py b/griptape/tools/sql/__init__.py similarity index 100% rename from griptape/tools/sql_client/__init__.py rename to griptape/tools/sql/__init__.py diff --git a/griptape/tools/sql_client/manifest.yml b/griptape/tools/sql/manifest.yml similarity index 88% rename from griptape/tools/sql_client/manifest.yml rename to griptape/tools/sql/manifest.yml index 22d0f4be2..2e1459a0d 100644 --- a/griptape/tools/sql_client/manifest.yml +++ b/griptape/tools/sql/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: SQL Client +name: SQL Tool description: Tool for executing SQL queries. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal \ No newline at end of file diff --git a/griptape/tools/sql_client/tool.py b/griptape/tools/sql/tool.py similarity index 98% rename from griptape/tools/sql_client/tool.py rename to griptape/tools/sql/tool.py index 2de598c6b..a84bb87be 100644 --- a/griptape/tools/sql_client/tool.py +++ b/griptape/tools/sql/tool.py @@ -14,7 +14,7 @@ @define -class SqlClient(BaseTool): +class SqlTool(BaseTool): sql_loader: SqlLoader = field(kw_only=True) schema_name: Optional[str] = field(default=None, kw_only=True) table_name: str = field(kw_only=True) diff --git a/griptape/tools/structure_run_client/__init__.py b/griptape/tools/structure_run/__init__.py similarity index 100% rename from griptape/tools/structure_run_client/__init__.py rename to griptape/tools/structure_run/__init__.py diff --git a/griptape/tools/structure_run_client/manifest.yml b/griptape/tools/structure_run/manifest.yml similarity index 83% rename from griptape/tools/structure_run_client/manifest.yml rename to griptape/tools/structure_run/manifest.yml index 5f53158d8..b5feb835a 100644 --- a/griptape/tools/structure_run_client/manifest.yml +++ b/griptape/tools/structure_run/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Structure Run Client +name: Structure Run Tool description: Tool for running a Structure. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/structure_run_client/tool.py b/griptape/tools/structure_run/tool.py similarity index 97% rename from griptape/tools/structure_run_client/tool.py rename to griptape/tools/structure_run/tool.py index f4f6c3786..cda4f0b35 100644 --- a/griptape/tools/structure_run_client/tool.py +++ b/griptape/tools/structure_run/tool.py @@ -14,7 +14,7 @@ @define -class StructureRunClient(BaseTool): +class StructureRunTool(BaseTool): """Tool for running a Structure. Attributes: diff --git a/griptape/tools/task_memory_client/__init__.py b/griptape/tools/task_memory/__init__.py similarity index 100% rename from griptape/tools/task_memory_client/__init__.py rename to griptape/tools/task_memory/__init__.py diff --git a/griptape/tools/task_memory_client/manifest.yml b/griptape/tools/task_memory/manifest.yml similarity index 85% rename from griptape/tools/task_memory_client/manifest.yml rename to griptape/tools/task_memory/manifest.yml index 0bff1af3d..5d40a1e68 100644 --- a/griptape/tools/task_memory_client/manifest.yml +++ b/griptape/tools/task_memory/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Task Memory Client +name: Task Memory Tool description: Tool for summarizing and querying TaskMemory. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal \ No newline at end of file diff --git a/griptape/tools/task_memory_client/tool.py b/griptape/tools/task_memory/tool.py similarity index 98% rename from griptape/tools/task_memory_client/tool.py rename to griptape/tools/task_memory/tool.py index 160a54d85..dfd6c7c4b 100644 --- a/griptape/tools/task_memory_client/tool.py +++ b/griptape/tools/task_memory/tool.py @@ -9,7 +9,7 @@ @define -class TaskMemoryClient(BaseTool): +class TaskMemoryTool(BaseTool): @activity( config={ "description": "Can be used to summarize memory content", diff --git a/griptape/tools/text_to_speech_client/__init__.py b/griptape/tools/text_to_speech/__init__.py similarity index 100% rename from griptape/tools/text_to_speech_client/__init__.py rename to griptape/tools/text_to_speech/__init__.py diff --git a/griptape/tools/text_to_speech_client/manifest.yml b/griptape/tools/text_to_speech/manifest.yml similarity index 83% rename from griptape/tools/text_to_speech_client/manifest.yml rename to griptape/tools/text_to_speech/manifest.yml index 73062bb13..875e04576 100644 --- a/griptape/tools/text_to_speech_client/manifest.yml +++ b/griptape/tools/text_to_speech/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Text to Speech Client +name: Text to Speech Tool description: A tool for generating speech from text. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/text_to_speech_client/tool.py b/griptape/tools/text_to_speech/tool.py similarity index 95% rename from griptape/tools/text_to_speech_client/tool.py rename to griptape/tools/text_to_speech/tool.py index 295641fd3..95a42d0ae 100644 --- a/griptape/tools/text_to_speech_client/tool.py +++ b/griptape/tools/text_to_speech/tool.py @@ -15,7 +15,7 @@ @define -class TextToSpeechClient(BlobArtifactFileOutputMixin, BaseTool): +class TextToSpeechTool(BlobArtifactFileOutputMixin, BaseTool): """A tool that can be used to generate speech from input text. Attributes: diff --git a/griptape/tools/variation_image_generation_client/__init__.py b/griptape/tools/variation_image_generation/__init__.py similarity index 100% rename from griptape/tools/variation_image_generation_client/__init__.py rename to griptape/tools/variation_image_generation/__init__.py diff --git a/griptape/tools/variation_image_generation_client/manifest.yml b/griptape/tools/variation_image_generation/manifest.yml similarity index 79% rename from griptape/tools/variation_image_generation_client/manifest.yml rename to griptape/tools/variation_image_generation/manifest.yml index eb9371016..1f3eb28e8 100644 --- a/griptape/tools/variation_image_generation_client/manifest.yml +++ b/griptape/tools/variation_image_generation/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Variation Image Generation Client +name: Variation Image Generation Tool description: Tool for generating variations of existing images. contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/variation_image_generation_client/requirements.txt b/griptape/tools/variation_image_generation/requirements.txt similarity index 100% rename from griptape/tools/variation_image_generation_client/requirements.txt rename to griptape/tools/variation_image_generation/requirements.txt diff --git a/griptape/tools/variation_image_generation_client/tool.py b/griptape/tools/variation_image_generation/tool.py similarity index 91% rename from griptape/tools/variation_image_generation_client/tool.py rename to griptape/tools/variation_image_generation/tool.py index 5f836c5b1..9691f6206 100644 --- a/griptape/tools/variation_image_generation_client/tool.py +++ b/griptape/tools/variation_image_generation/tool.py @@ -8,7 +8,7 @@ from griptape.artifacts import ErrorArtifact, ImageArtifact from griptape.loaders import ImageLoader -from griptape.tools.base_image_generation_client import BaseImageGenerationClient +from griptape.tools.base_image_generation_tool import BaseImageGenerationTool from griptape.utils.decorators import activity from griptape.utils.load_artifact_from_memory import load_artifact_from_memory @@ -17,7 +17,7 @@ @define -class VariationImageGenerationClient(BaseImageGenerationClient): +class VariationImageGenerationTool(BaseImageGenerationTool): """A tool that can be used to generate prompted variations of an image. Attributes: @@ -34,8 +34,8 @@ class VariationImageGenerationClient(BaseImageGenerationClient): "description": "Generates a variation of a given input image file.", "schema": Schema( { - Literal("prompt", description=BaseImageGenerationClient.PROMPT_DESCRIPTION): str, - Literal("negative_prompt", description=BaseImageGenerationClient.NEGATIVE_PROMPT_DESCRIPTION): str, + Literal("prompt", description=BaseImageGenerationTool.PROMPT_DESCRIPTION): str, + Literal("negative_prompt", description=BaseImageGenerationTool.NEGATIVE_PROMPT_DESCRIPTION): str, Literal( "image_file", description="The path to an image file to be used as a base to generate variations from.", @@ -61,8 +61,8 @@ def image_variation_from_file(self, params: dict[str, dict[str, str]]) -> ImageA "description": "Generates a variation of a given input image artifact in memory.", "schema": Schema( { - Literal("prompt", description=BaseImageGenerationClient.PROMPT_DESCRIPTION): str, - Literal("negative_prompt", description=BaseImageGenerationClient.NEGATIVE_PROMPT_DESCRIPTION): str, + Literal("prompt", description=BaseImageGenerationTool.PROMPT_DESCRIPTION): str, + Literal("negative_prompt", description=BaseImageGenerationTool.NEGATIVE_PROMPT_DESCRIPTION): str, "memory_name": str, "artifact_namespace": str, "artifact_name": str, diff --git a/griptape/tools/vector_store_client/__init__.py b/griptape/tools/vector_store/__init__.py similarity index 100% rename from griptape/tools/vector_store_client/__init__.py rename to griptape/tools/vector_store/__init__.py diff --git a/griptape/tools/vector_store_client/manifest.yml b/griptape/tools/vector_store/manifest.yml similarity index 85% rename from griptape/tools/vector_store_client/manifest.yml rename to griptape/tools/vector_store/manifest.yml index a1a1d1d0c..d1fab7ce5 100644 --- a/griptape/tools/vector_store_client/manifest.yml +++ b/griptape/tools/vector_store/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Vector Store Client +name: Vector Store Tool description: Tool for storing and accessing data in vector stores contact_email: hello@griptape.ai legal_info_url: https://www.griptape.ai/legal \ No newline at end of file diff --git a/griptape/tools/vector_store_client/requirements.txt b/griptape/tools/vector_store/requirements.txt similarity index 100% rename from griptape/tools/vector_store_client/requirements.txt rename to griptape/tools/vector_store/requirements.txt diff --git a/griptape/tools/vector_store_client/tool.py b/griptape/tools/vector_store/tool.py similarity index 98% rename from griptape/tools/vector_store_client/tool.py rename to griptape/tools/vector_store/tool.py index a0c638eef..71902b1c7 100644 --- a/griptape/tools/vector_store_client/tool.py +++ b/griptape/tools/vector_store/tool.py @@ -14,7 +14,7 @@ @define(kw_only=True) -class VectorStoreClient(BaseTool): +class VectorStoreTool(BaseTool): """A tool for querying a vector database. Attributes: diff --git a/griptape/tools/web_scraper/manifest.yml b/griptape/tools/web_scraper/manifest.yml index e2d0597ec..ec9d3db25 100644 --- a/griptape/tools/web_scraper/manifest.yml +++ b/griptape/tools/web_scraper/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Web Scraper +name: Web Scraper Tool description: Tool for scraping web pages for content, titles, authors, and keywords. contact_email: hello@griptape.ai -legal_info_url: https://www.griptape.ai/legal \ No newline at end of file +legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/web_scraper/tool.py b/griptape/tools/web_scraper/tool.py index 782e85d37..c27aaa066 100644 --- a/griptape/tools/web_scraper/tool.py +++ b/griptape/tools/web_scraper/tool.py @@ -10,7 +10,7 @@ @define -class WebScraper(BaseTool): +class WebScraperTool(BaseTool): web_loader: WebLoader = field(default=Factory(lambda: WebLoader()), kw_only=True) @activity( diff --git a/griptape/tools/web_search/manifest.yml b/griptape/tools/web_search/manifest.yml index 4bb2a82c8..c06db4f20 100644 --- a/griptape/tools/web_search/manifest.yml +++ b/griptape/tools/web_search/manifest.yml @@ -1,5 +1,5 @@ version: "v1" -name: Google Search -description: Tool for making making web searches on Google. +name: Web Search Tool +description: Tool for making making web searches. contact_email: hello@griptape.ai -legal_info_url: https://www.griptape.ai/legal \ No newline at end of file +legal_info_url: https://www.griptape.ai/legal diff --git a/griptape/tools/web_search/tool.py b/griptape/tools/web_search/tool.py index 43f975acd..557c26a52 100644 --- a/griptape/tools/web_search/tool.py +++ b/griptape/tools/web_search/tool.py @@ -14,7 +14,7 @@ @define -class WebSearch(BaseTool): +class WebSearchTool(BaseTool): web_search_driver: BaseWebSearchDriver = field(kw_only=True) @activity( diff --git a/mkdocs.yml b/mkdocs.yml index 175918e87..ce1772754 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -129,34 +129,34 @@ nav: - Tools: - Overview: "griptape-tools/index.md" - Official Tools: - - AwsIamClient: "griptape-tools/official-tools/aws-iam-client.md" - - AwsS3Client: "griptape-tools/official-tools/aws-s3-client.md" - - Calculator: "griptape-tools/official-tools/calculator.md" - - Computer: "griptape-tools/official-tools/computer.md" - - DateTime: "griptape-tools/official-tools/date-time.md" - - EmailClient: "griptape-tools/official-tools/email-client.md" - - FileManager: "griptape-tools/official-tools/file-manager.md" - - GoogleCalendarClient: "griptape-tools/official-tools/google-cal-client.md" - - GoogleGmailClient: "griptape-tools/official-tools/google-gmail-client.md" - - GoogleDriveClient: "griptape-tools/official-tools/google-drive-client.md" - - GoogleDocsClient: "griptape-tools/official-tools/google-docs-client.md" - - StructureRunClient: "griptape-tools/official-tools/structure-run-client.md" - - OpenWeatherClient: "griptape-tools/official-tools/openweather-client.md" - - RestApiClient: "griptape-tools/official-tools/rest-api-client.md" - - SqlClient: "griptape-tools/official-tools/sql-client.md" - - TaskMemoryClient: "griptape-tools/official-tools/task-memory-client.md" - - VectorStoreClient: "griptape-tools/official-tools/vector-store-client.md" - - WebScraper: "griptape-tools/official-tools/web-scraper.md" - - WebSearch: "griptape-tools/official-tools/web-search.md" - - PromptImageGenerationClient: "griptape-tools/official-tools/prompt-image-generation-client.md" - - VariationImageGenerationClient: "griptape-tools/official-tools/variation-image-generation-client.md" - - InpaintingImageGenerationClient: "griptape-tools/official-tools/inpainting-image-generation-client.md" - - OutpaintingImageGenerationClient: "griptape-tools/official-tools/outpainting-image-generation-client.md" - - ImageQueryClient: "griptape-tools/official-tools/image-query-client.md" - - TextToSpeechClient: "griptape-tools/official-tools/text-to-speech-client.md" - - AudioTranscriptionClient: "griptape-tools/official-tools/audio-transcription-client.md" - - GriptapeCloudKnowledgeBaseClient: "griptape-tools/official-tools/griptape-cloud-knowledge-base-client.md" - - RagClient: "griptape-tools/official-tools/rag-client.md" + - Aws Iam: "griptape-tools/official-tools/aws-iam-tool.md" + - Aws S3: "griptape-tools/official-tools/aws-s3-tool.md" + - Calculator: "griptape-tools/official-tools/calculator-tool.md" + - Computer: "griptape-tools/official-tools/computer-tool.md" + - Date Time: "griptape-tools/official-tools/date-time-tool.md" + - Email: "griptape-tools/official-tools/email-tool.md" + - File Manager: "griptape-tools/official-tools/file-manager-tool.md" + - Google Calendar: "griptape-tools/official-tools/google-calendar-tool.md" + - Google Gmail: "griptape-tools/official-tools/google-gmail-tool.md" + - Google Drive: "griptape-tools/official-tools/google-drive-tool.md" + - Google Docs: "griptape-tools/official-tools/google-docs-tool.md" + - Structure Run Client: "griptape-tools/official-tools/structure-run-tool.md" + - Open Weather: "griptape-tools/official-tools/openweather-tool.md" + - Rest Api Client: "griptape-tools/official-tools/rest-api-tool.md" + - Sql: "griptape-tools/official-tools/sql-tool.md" + - Task Memory: "griptape-tools/official-tools/task-memory-tool.md" + - Vector Store Tool: "griptape-tools/official-tools/vector-store-tool.md" + - Web Scraper: "griptape-tools/official-tools/web-scraper-tool.md" + - Web Search: "griptape-tools/official-tools/web-search-tool.md" + - Prompt Image Generation: "griptape-tools/official-tools/prompt-image-generation-tool.md" + - Variation ImageGeneration: "griptape-tools/official-tools/variation-image-generation-tool.md" + - Inpainting ImageGeneration: "griptape-tools/official-tools/inpainting-image-generation-tool.md" + - Outpainting ImageGeneration: "griptape-tools/official-tools/outpainting-image-generation-tool.md" + - Image Query: "griptape-tools/official-tools/image-query-tool.md" + - Text To Speech: "griptape-tools/official-tools/text-to-speech-tool.md" + - Audio Transcription: "griptape-tools/official-tools/audio-transcription-tool.md" + - Griptape Cloud Knowledge Base: "griptape-tools/official-tools/griptape-cloud-knowledge-base-tool.md" + - Rag: "griptape-tools/official-tools/rag-tool.md" - Custom Tools: - Building Custom Tools: "griptape-tools/custom-tools/index.md" - Recipes: diff --git a/tests/integration/tasks/test_tool_task.py b/tests/integration/tasks/test_tool_task.py index aee0af110..426dde995 100644 --- a/tests/integration/tasks/test_tool_task.py +++ b/tests/integration/tasks/test_tool_task.py @@ -10,10 +10,10 @@ class TestToolTask: def structure_tester(self, request): from griptape.structures import Agent from griptape.tasks import ToolTask - from griptape.tools import Calculator + from griptape.tools import CalculatorTool return StructureTester( - Agent(tasks=[ToolTask(tool=Calculator())], conversation_memory=None, prompt_driver=request.param) + Agent(tasks=[ToolTask(tool=CalculatorTool())], conversation_memory=None, prompt_driver=request.param) ) def test_tool_task(self, structure_tester): diff --git a/tests/integration/tasks/test_toolkit_task.py b/tests/integration/tasks/test_toolkit_task.py index 8dfcfdc73..5cb1aa0dc 100644 --- a/tests/integration/tasks/test_toolkit_task.py +++ b/tests/integration/tasks/test_toolkit_task.py @@ -14,18 +14,18 @@ def structure_tester(self, request): from griptape.drivers import GoogleWebSearchDriver from griptape.structures import Agent - from griptape.tools import TaskMemoryClient, WebScraper, WebSearch + from griptape.tools import TaskMemoryTool, WebScraperTool, WebSearchTool return StructureTester( Agent( tools=[ - WebSearch( + WebSearchTool( web_search_driver=GoogleWebSearchDriver( api_key=os.environ["GOOGLE_API_KEY"], search_id=os.environ["GOOGLE_API_SEARCH_ID"] ) ), - WebScraper(off_prompt=True), - TaskMemoryClient(off_prompt=False), + WebScraperTool(off_prompt=True), + TaskMemoryTool(off_prompt=False), ], conversation_memory=None, prompt_driver=request.param, diff --git a/tests/integration/test_code_blocks.py b/tests/integration/test_code_blocks.py index 2e9aac01f..c9c666b0e 100644 --- a/tests/integration/test_code_blocks.py +++ b/tests/integration/test_code_blocks.py @@ -4,7 +4,7 @@ import pytest SKIP_FILES = [ - "docs/griptape-tools/official-tools/src/computer_1.py", + "docs/griptape-tools/official-tools/src/computer_tool_1.py", "docs/examples/src/load_query_and_chat_marqo_1.py", "docs/griptape-framework/drivers/src/embedding_drivers_2.py", "docs/griptape-framework/drivers/src/embedding_drivers_6.py", diff --git a/tests/integration/tools/test_calculator.py b/tests/integration/tools/test_calculator_tool.py similarity index 73% rename from tests/integration/tools/test_calculator.py rename to tests/integration/tools/test_calculator_tool.py index 2547b947d..c209a9a2c 100644 --- a/tests/integration/tools/test_calculator.py +++ b/tests/integration/tools/test_calculator_tool.py @@ -11,9 +11,9 @@ class TestCalculator: ) def structure_tester(self, request): from griptape.structures import Agent - from griptape.tools import Calculator + from griptape.tools import CalculatorTool - return StructureTester(Agent(tools=[Calculator()], conversation_memory=None, prompt_driver=request.param)) + return StructureTester(Agent(tools=[CalculatorTool()], conversation_memory=None, prompt_driver=request.param)) def test_calculate(self, structure_tester): structure_tester.run("What is 7 times 3 divided by 5 plus 10.") diff --git a/tests/integration/tools/test_file_manager.py b/tests/integration/tools/test_file_manager_tool.py similarity index 79% rename from tests/integration/tools/test_file_manager.py rename to tests/integration/tools/test_file_manager_tool.py index 8a283c6e8..4b5299175 100644 --- a/tests/integration/tools/test_file_manager.py +++ b/tests/integration/tools/test_file_manager_tool.py @@ -11,9 +11,9 @@ class TestFileManager: ) def structure_tester(self, request): from griptape.structures import Agent - from griptape.tools import FileManager + from griptape.tools import FileManagerTool - return StructureTester(Agent(tools=[FileManager()], conversation_memory=None, prompt_driver=request.param)) + return StructureTester(Agent(tools=[FileManagerTool()], conversation_memory=None, prompt_driver=request.param)) def test_save_content_to_disk(self, structure_tester): structure_tester.run('Write the content "Hello World!" to a file called "poem.txt".') diff --git a/tests/integration/tools/test_google_docs_client.py b/tests/integration/tools/test_google_docs_tool.py similarity index 95% rename from tests/integration/tools/test_google_docs_client.py rename to tests/integration/tools/test_google_docs_tool.py index 4d70aac17..7c8828dd3 100644 --- a/tests/integration/tools/test_google_docs_client.py +++ b/tests/integration/tools/test_google_docs_tool.py @@ -5,7 +5,7 @@ from tests.utils.structure_tester import StructureTester -class TestGoogleDocsClient: +class TestGoogleDocsTool: @pytest.fixture( autouse=True, params=StructureTester.TOOLKIT_TASK_CAPABLE_PROMPT_DRIVERS, @@ -13,12 +13,12 @@ class TestGoogleDocsClient: ) def structure_tester(self, request): from griptape.structures import Agent - from griptape.tools import GoogleDocsClient + from griptape.tools import GoogleDocsTool return StructureTester( Agent( tools=[ - GoogleDocsClient( + GoogleDocsTool( service_account_credentials={ "type": os.environ["GOOGLE_ACCOUNT_TYPE"], "project_id": os.environ["GOOGLE_PROJECT_ID"], diff --git a/tests/integration/tools/test_google_drive_client.py b/tests/integration/tools/test_google_drive_tool.py similarity index 94% rename from tests/integration/tools/test_google_drive_client.py rename to tests/integration/tools/test_google_drive_tool.py index 23ebb1b32..7fd8b9047 100644 --- a/tests/integration/tools/test_google_drive_client.py +++ b/tests/integration/tools/test_google_drive_tool.py @@ -5,7 +5,7 @@ from tests.utils.structure_tester import StructureTester -class TestGoogleDriveClient: +class TestGoogleDriveTool: @pytest.fixture( autouse=True, params=StructureTester.TOOLKIT_TASK_CAPABLE_PROMPT_DRIVERS, @@ -13,12 +13,12 @@ class TestGoogleDriveClient: ) def structure_tester(self, request): from griptape.structures import Agent - from griptape.tools import GoogleDriveClient + from griptape.tools import GoogleDriveTool return StructureTester( Agent( tools=[ - GoogleDriveClient( + GoogleDriveTool( service_account_credentials={ "type": os.environ["GOOGLE_ACCOUNT_TYPE"], "project_id": os.environ["GOOGLE_PROJECT_ID"], diff --git a/tests/unit/tools/test_aws_iam.py b/tests/unit/tools/test_aws_iam_tool.py similarity index 56% rename from tests/unit/tools/test_aws_iam.py rename to tests/unit/tools/test_aws_iam_tool.py index 54dbaa5fb..fb2b1e381 100644 --- a/tests/unit/tools/test_aws_iam.py +++ b/tests/unit/tools/test_aws_iam_tool.py @@ -1,11 +1,11 @@ import boto3 import pytest -from griptape.tools import AwsIamClient +from griptape.tools import AwsIamTool from tests.utils.aws import mock_aws_credentials -class TestAwsIamClient: +class TestAwsIamTool: @pytest.fixture(autouse=True) def _run_before_and_after_tests(self): mock_aws_credentials() @@ -14,18 +14,18 @@ def test_get_user_policy(self): value = {"user_name": "test_user", "policy_name": "test_policy"} assert ( "error returning policy document" - in AwsIamClient(session=boto3.Session()).get_user_policy({"values": value}).value + in AwsIamTool(session=boto3.Session()).get_user_policy({"values": value}).value ) def test_list_mfa_devices(self): - assert "error listing mfa devices" in AwsIamClient(session=boto3.Session()).list_mfa_devices({}).value + assert "error listing mfa devices" in AwsIamTool(session=boto3.Session()).list_mfa_devices({}).value def test_list_user_policies(self): value = {"user_name": "test_user"} assert ( "error listing iam user policies" - in AwsIamClient(session=boto3.Session()).list_user_policies({"values": value}).value + in AwsIamTool(session=boto3.Session()).list_user_policies({"values": value}).value ) def test_list_users(self): - assert "error listing s3 users" in AwsIamClient(session=boto3.Session()).list_users({}).value + assert "error listing s3 users" in AwsIamTool(session=boto3.Session()).list_users({}).value diff --git a/tests/unit/tools/test_aws_s3.py b/tests/unit/tools/test_aws_s3_tool.py similarity index 58% rename from tests/unit/tools/test_aws_s3.py rename to tests/unit/tools/test_aws_s3_tool.py index 5c6a4c151..9c4c34e0b 100644 --- a/tests/unit/tools/test_aws_s3.py +++ b/tests/unit/tools/test_aws_s3_tool.py @@ -1,42 +1,38 @@ import boto3 import pytest -from griptape.tools import AwsS3Client +from griptape.tools import AwsS3Tool from tests.utils.aws import mock_aws_credentials -class TestAwsS3Client: +class TestAwsS3Tool: @pytest.fixture(autouse=True) def _run_before_and_after_tests(self): mock_aws_credentials() def test_get_bucket_acl(self): value = {"bucket_name": "bucket_test"} - assert ( - "error getting bucket acl" in AwsS3Client(session=boto3.Session()).get_bucket_acl({"values": value}).value - ) + assert "error getting bucket acl" in AwsS3Tool(session=boto3.Session()).get_bucket_acl({"values": value}).value def test_get_bucket_policy(self): value = {"bucket_name": "bucket_test"} assert ( "error getting bucket policy" - in AwsS3Client(session=boto3.Session()).get_bucket_policy({"values": value}).value + in AwsS3Tool(session=boto3.Session()).get_bucket_policy({"values": value}).value ) def test_get_object_acl(self): value = {"bucket_name": "bucket_test", "object_key": "key_test"} - assert ( - "error getting object acl" in AwsS3Client(session=boto3.Session()).get_object_acl({"values": value}).value - ) + assert "error getting object acl" in AwsS3Tool(session=boto3.Session()).get_object_acl({"values": value}).value def test_list_s3_buckets(self): - assert "error listing s3 buckets" in AwsS3Client(session=boto3.Session()).list_s3_buckets({}).value + assert "error listing s3 buckets" in AwsS3Tool(session=boto3.Session()).list_s3_buckets({}).value def test_list_objects(self): value = {"bucket_name": "bucket_test"} assert ( "error listing objects in bucket" - in AwsS3Client(session=boto3.Session()).list_objects({"values": value}).value + in AwsS3Tool(session=boto3.Session()).list_objects({"values": value}).value ) def test_upload_memory_artifacts_to_s3(self): @@ -48,7 +44,7 @@ def test_upload_memory_artifacts_to_s3(self): } assert ( "memory not found" - in AwsS3Client(session=boto3.Session()).upload_memory_artifacts_to_s3({"values": value}).value + in AwsS3Tool(session=boto3.Session()).upload_memory_artifacts_to_s3({"values": value}).value ) def test_upload_content_to_s3(self): @@ -56,13 +52,12 @@ def test_upload_content_to_s3(self): assert ( "error uploading objects" - in AwsS3Client(session=boto3.Session()).upload_content_to_s3({"values": value}).value + in AwsS3Tool(session=boto3.Session()).upload_content_to_s3({"values": value}).value ) def test_download_objects(self): value = {"objects": {"bucket_name": "bucket_test", "object_key": "test.txt"}} assert ( - "error downloading objects" - in AwsS3Client(session=boto3.Session()).download_objects({"values": value}).value + "error downloading objects" in AwsS3Tool(session=boto3.Session()).download_objects({"values": value}).value ) diff --git a/tests/unit/tools/test_calculator.py b/tests/unit/tools/test_calculator.py index 72a525210..e598867f9 100644 --- a/tests/unit/tools/test_calculator.py +++ b/tests/unit/tools/test_calculator.py @@ -1,6 +1,6 @@ -from griptape.tools import Calculator +from griptape.tools import CalculatorTool class TestCalculator: def test_calculate(self): - assert Calculator().calculate({"values": {"expression": "5 * 5"}}).value == "25" + assert CalculatorTool().calculate({"values": {"expression": "5 * 5"}}).value == "25" diff --git a/tests/unit/tools/test_computer.py b/tests/unit/tools/test_computer.py index 95de18ae3..1f6e5c7a6 100644 --- a/tests/unit/tools/test_computer.py +++ b/tests/unit/tools/test_computer.py @@ -1,13 +1,13 @@ import pytest -from griptape.tools import Computer +from griptape.tools import ComputerTool from tests.mocks.docker.fake_api_client import make_fake_client class TestComputer: @pytest.fixture() def computer(self): - return Computer(docker_client=make_fake_client(), install_dependencies_on_init=False) + return ComputerTool(docker_client=make_fake_client(), install_dependencies_on_init=False) def test_execute_code(self, computer): assert computer.execute_code({"values": {"code": "print(1)", "filename": "foo.py"}}).value == "hello world" diff --git a/tests/unit/tools/test_date_time.py b/tests/unit/tools/test_date_time.py index c534ae69b..9fa2ce4bb 100644 --- a/tests/unit/tools/test_date_time.py +++ b/tests/unit/tools/test_date_time.py @@ -1,28 +1,28 @@ from datetime import datetime -from griptape.tools import DateTime +from griptape.tools import DateTimeTool class TestDateTime: def test_get_current_datetime(self): - result = DateTime().get_current_datetime({}) + result = DateTimeTool().get_current_datetime({}) time_delta = datetime.strptime(result.value, "%Y-%m-%d %H:%M:%S.%f") - datetime.now() assert abs(time_delta.total_seconds()) <= 1000 def test_get_past_relative_datetime(self): - result = DateTime().get_relative_datetime({"values": {"relative_date_string": "5 min ago"}}) + result = DateTimeTool().get_relative_datetime({"values": {"relative_date_string": "5 min ago"}}) time_delta = datetime.strptime(result.value, "%Y-%m-%d %H:%M:%S.%f") - datetime.now() assert abs(time_delta.total_seconds()) <= 1000 - result = DateTime().get_relative_datetime({"values": {"relative_date_string": "2 min ago, 12 seconds"}}) + result = DateTimeTool().get_relative_datetime({"values": {"relative_date_string": "2 min ago, 12 seconds"}}) time_delta = datetime.strptime(result.value, "%Y-%m-%d %H:%M:%S.%f") - datetime.now() assert abs(time_delta.total_seconds()) <= 1000 def test_get_future_relative_datetime(self): - result = DateTime().get_relative_datetime({"values": {"relative_date_string": "in 1 min, 36 seconds"}}) + result = DateTimeTool().get_relative_datetime({"values": {"relative_date_string": "in 1 min, 36 seconds"}}) time_delta = datetime.strptime(result.value, "%Y-%m-%d %H:%M:%S.%f") - datetime.now() assert abs(time_delta.total_seconds()) <= 1000 def test_get_invalid_relative_datetime(self): - result = DateTime().get_relative_datetime({"values": {"relative_date_string": "3 days from now"}}) + result = DateTimeTool().get_relative_datetime({"values": {"relative_date_string": "3 days from now"}}) assert result.type == "ErrorArtifact" diff --git a/tests/unit/tools/test_email_client.py b/tests/unit/tools/test_email_tool.py similarity index 93% rename from tests/unit/tools/test_email_client.py rename to tests/unit/tools/test_email_tool.py index cf99009b8..6c0f7cbd7 100644 --- a/tests/unit/tools/test_email_client.py +++ b/tests/unit/tools/test_email_tool.py @@ -2,14 +2,14 @@ from griptape.artifacts import ErrorArtifact, InfoArtifact, ListArtifact, TextArtifact from griptape.loaders.email_loader import EmailLoader -from griptape.tools import EmailClient +from griptape.tools import EmailTool -class TestEmailClient: +class TestEmailTool: @pytest.fixture(autouse=True) def mock_email_loader(self, mocker): mock_email_loader = mocker.patch( - "griptape.tools.email_client.tool.EmailLoader", + "griptape.tools.email.tool.EmailLoader", EmailQuery=EmailLoader.EmailQuery, # Prevents mocking the nested EmailQuery class ).return_value mock_email_loader.load.return_value = ListArtifact([TextArtifact("fake-email-content")]) @@ -29,7 +29,7 @@ def mock_smtp_ssl(self, mocker): @pytest.fixture() def client(self): - return EmailClient( + return EmailTool( username="fake-username", password="fake-password", smtp_host="foobar.com", @@ -63,7 +63,7 @@ def test_retrieve(self, client, mock_email_loader, values, query): def test_retrieve_when_email_max_retrieve_count_set(self, mock_email_loader): # Given - client = EmailClient(email_max_retrieve_count=84, mailboxes={"INBOX": "default mailbox for incoming email"}) + client = EmailTool(email_max_retrieve_count=84, mailboxes={"INBOX": "default mailbox for incoming email"}) # When client.retrieve({"values": {"label": "fake-label"}}) @@ -91,7 +91,7 @@ def test_send(self, client, send_params): def test_send_when_smtp_overrides_set(self, send_params): # Given - client = EmailClient( + client = EmailTool( smtp_host="smtp-host", smtp_port=86, smtp_use_ssl=False, diff --git a/tests/unit/tools/test_file_manager.py b/tests/unit/tools/test_file_manager.py index 57dd2c83e..dccf2f1a2 100644 --- a/tests/unit/tools/test_file_manager.py +++ b/tests/unit/tools/test_file_manager.py @@ -9,14 +9,14 @@ from griptape.artifacts.error_artifact import ErrorArtifact from griptape.drivers.file_manager.local_file_manager_driver import LocalFileManagerDriver from griptape.loaders.text_loader import TextLoader -from griptape.tools import FileManager +from griptape.tools import FileManagerTool from tests.utils import defaults class TestFileManager: @pytest.fixture() def file_manager(self): - return FileManager( + return FileManagerTool( input_memory=[defaults.text_task_memory("Memory1")], file_manager_driver=LocalFileManagerDriver(workdir=os.path.abspath(os.path.dirname(__file__))), ) @@ -47,7 +47,7 @@ def test_load_files_from_disk_with_encoding(self, file_manager): assert isinstance(result.value[0], TextArtifact) def test_load_files_from_disk_with_encoding_failure(self): - file_manager = FileManager( + file_manager = FileManagerTool( file_manager_driver=LocalFileManagerDriver( default_loader=TextLoader(encoding="utf-8"), loaders={}, @@ -65,7 +65,9 @@ def test_save_memory_artifacts_to_disk_for_one_artifact(self, temp_dir): memory.store_artifact("foobar", artifact) - file_manager = FileManager(input_memory=[memory], file_manager_driver=LocalFileManagerDriver(workdir=temp_dir)) + file_manager = FileManagerTool( + input_memory=[memory], file_manager_driver=LocalFileManagerDriver(workdir=temp_dir) + ) result = file_manager.save_memory_artifacts_to_disk( { "values": { @@ -88,7 +90,9 @@ def test_save_memory_artifacts_to_disk_for_multiple_artifacts(self, temp_dir): for a in artifacts: memory.store_artifact("foobar", a) - file_manager = FileManager(input_memory=[memory], file_manager_driver=LocalFileManagerDriver(workdir=temp_dir)) + file_manager = FileManagerTool( + input_memory=[memory], file_manager_driver=LocalFileManagerDriver(workdir=temp_dir) + ) result = file_manager.save_memory_artifacts_to_disk( { "values": { @@ -105,7 +109,7 @@ def test_save_memory_artifacts_to_disk_for_multiple_artifacts(self, temp_dir): assert result.value == "Successfully saved memory artifacts to disk" def test_save_content_to_file(self, temp_dir): - file_manager = FileManager(file_manager_driver=LocalFileManagerDriver(workdir=temp_dir)) + file_manager = FileManagerTool(file_manager_driver=LocalFileManagerDriver(workdir=temp_dir)) result = file_manager.save_content_to_file( {"values": {"path": os.path.join("test", "foobar.txt"), "content": "foobar"}} ) @@ -114,7 +118,7 @@ def test_save_content_to_file(self, temp_dir): assert result.value == "Successfully saved file" def test_save_content_to_file_with_encoding(self, temp_dir): - file_manager = FileManager( + file_manager = FileManagerTool( file_manager_driver=LocalFileManagerDriver(default_loader=TextLoader(encoding="utf-8"), workdir=temp_dir) ) result = file_manager.save_content_to_file( @@ -125,7 +129,7 @@ def test_save_content_to_file_with_encoding(self, temp_dir): assert result.value == "Successfully saved file" def test_save_and_load_content_to_file_with_encoding(self, temp_dir): - file_manager = FileManager( + file_manager = FileManagerTool( file_manager_driver=LocalFileManagerDriver(loaders={"txt": TextLoader(encoding="ascii")}, workdir=temp_dir) ) result = file_manager.save_content_to_file( @@ -135,7 +139,7 @@ def test_save_and_load_content_to_file_with_encoding(self, temp_dir): assert Path(os.path.join(temp_dir, "test", "foobar.txt")).read_text() == "foobar" assert result.value == "Successfully saved file" - file_manager = FileManager( + file_manager = FileManagerTool( file_manager_driver=LocalFileManagerDriver( default_loader=TextLoader(encoding="ascii"), loaders={}, workdir=temp_dir ) diff --git a/tests/unit/tools/test_google_docs_client.py b/tests/unit/tools/test_google_docs_tool.py similarity index 84% rename from tests/unit/tools/test_google_docs_client.py rename to tests/unit/tools/test_google_docs_tool.py index a42fddda3..516961c61 100644 --- a/tests/unit/tools/test_google_docs_client.py +++ b/tests/unit/tools/test_google_docs_tool.py @@ -1,12 +1,12 @@ import pytest -class TestGoogleDocsClient: +class TestGoogleDocsTool: @pytest.fixture() def mock_docs_client(self): - from griptape.tools import GoogleDocsClient + from griptape.tools import GoogleDocsTool - return GoogleDocsClient(owner_email="tony@griptape.ai", service_account_credentials={}) + return GoogleDocsTool(owner_email="tony@griptape.ai", service_account_credentials={}) def test_append_text(self, mock_docs_client): params = {"file_path": "test_folder/test_document", "text": "Appending this text"} diff --git a/tests/unit/tools/test_google_drive_client.py b/tests/unit/tools/test_google_drive_tool.py similarity index 68% rename from tests/unit/tools/test_google_drive_client.py rename to tests/unit/tools/test_google_drive_tool.py index 55f3c168f..55eae2267 100644 --- a/tests/unit/tools/test_google_drive_client.py +++ b/tests/unit/tools/test_google_drive_tool.py @@ -1,11 +1,11 @@ from griptape.artifacts import ErrorArtifact -from griptape.tools import GoogleDriveClient +from griptape.tools import GoogleDriveTool -class TestGoogleDriveClient: +class TestGoogleDriveTool: def test_list_files(self): value = {"folder_path": "root"} # This can be any folder path you want to test - result = GoogleDriveClient(owner_email="tony@griptape.ai", service_account_credentials={}).list_files( + result = GoogleDriveTool(owner_email="tony@griptape.ai", service_account_credentials={}).list_files( {"values": value} ) @@ -14,16 +14,16 @@ def test_list_files(self): def test_save_content_to_drive(self): value = {"path": "/path/to/your/file.txt", "content": "Sample content for the file."} - result = GoogleDriveClient( - owner_email="tony@griptape.ai", service_account_credentials={} - ).save_content_to_drive({"values": value}) + result = GoogleDriveTool(owner_email="tony@griptape.ai", service_account_credentials={}).save_content_to_drive( + {"values": value} + ) assert isinstance(result, ErrorArtifact) assert "error saving file to Google Drive" in result.value def test_download_files(self): value = {"file_paths": ["example_folder/example_file.txt"]} - result = GoogleDriveClient(owner_email="tony@griptape.ai", service_account_credentials={}).download_files( + result = GoogleDriveTool(owner_email="tony@griptape.ai", service_account_credentials={}).download_files( {"values": value} ) @@ -33,7 +33,7 @@ def test_download_files(self): def test_search_files(self): value = {"search_mode": "name", "file_name": "search_file_name.txt"} - result = GoogleDriveClient(owner_email="tony@griptape.ai", service_account_credentials={}).search_files( + result = GoogleDriveTool(owner_email="tony@griptape.ai", service_account_credentials={}).search_files( {"values": value} ) @@ -43,7 +43,7 @@ def test_search_files(self): def test_share_file(self): value = {"file_path": "/path/to/your/file.txt", "email_address": "sample_email@example.com", "role": "reader"} - result = GoogleDriveClient(owner_email="tony@griptape.ai", service_account_credentials={}).share_file( + result = GoogleDriveTool(owner_email="tony@griptape.ai", service_account_credentials={}).share_file( {"values": value} ) diff --git a/tests/unit/tools/test_google_gmail_client.py b/tests/unit/tools/test_google_gmail_tool.py similarity index 61% rename from tests/unit/tools/test_google_gmail_client.py rename to tests/unit/tools/test_google_gmail_tool.py index 7dcf1de38..ace7ef0ba 100644 --- a/tests/unit/tools/test_google_gmail_client.py +++ b/tests/unit/tools/test_google_gmail_tool.py @@ -1,12 +1,12 @@ -from griptape.tools import GoogleGmailClient +from griptape.tools import GoogleGmailTool -class TestGoogleGmailClient: +class TestGoogleGmailTool: def test_create_draft_email(self): value = {"subject": "stacey's mom", "from": "test@test.com", "body": "got it going on"} assert ( "error creating draft email" - in GoogleGmailClient(service_account_credentials={}, owner_email="tony@griptape.ai") + in GoogleGmailTool(service_account_credentials={}, owner_email="tony@griptape.ai") .create_draft_email({"values": value}) .value ) diff --git a/tests/unit/tools/test_griptape_cloud_knowledge_base_client.py b/tests/unit/tools/test_griptape_cloud_knowledge_base_tool.py similarity index 83% rename from tests/unit/tools/test_griptape_cloud_knowledge_base_client.py rename to tests/unit/tools/test_griptape_cloud_knowledge_base_tool.py index 7d75d8670..b98713273 100644 --- a/tests/unit/tools/test_griptape_cloud_knowledge_base_client.py +++ b/tests/unit/tools/test_griptape_cloud_knowledge_base_tool.py @@ -4,10 +4,10 @@ from griptape.artifacts import ErrorArtifact, TextArtifact -class TestGriptapeCloudKnowledgeBaseClient: +class TestGriptapeCloudKnowledgeBaseTool: @pytest.fixture() def client(self, mocker): - from griptape.tools import GriptapeCloudKnowledgeBaseClient + from griptape.tools import GriptapeCloudKnowledgeBaseTool mock_response = mocker.Mock() mock_response.status_code = 201 @@ -19,45 +19,45 @@ def client(self, mocker): mock_response.json.return_value = {"description": "fizz buzz"} mocker.patch("requests.get", return_value=mock_response) - return GriptapeCloudKnowledgeBaseClient( + return GriptapeCloudKnowledgeBaseTool( base_url="https://api.griptape.ai", api_key="foo bar", knowledge_base_id="1" ) @pytest.fixture() def client_no_description(self, mocker): - from griptape.tools import GriptapeCloudKnowledgeBaseClient + from griptape.tools import GriptapeCloudKnowledgeBaseTool mock_response = mocker.Mock() mock_response.json.return_value = {} mock_response.status_code = 200 mocker.patch("requests.get", return_value=mock_response) - return GriptapeCloudKnowledgeBaseClient( + return GriptapeCloudKnowledgeBaseTool( base_url="https://api.griptape.ai", api_key="foo bar", knowledge_base_id="1" ) @pytest.fixture() def client_kb_not_found(self, mocker): - from griptape.tools import GriptapeCloudKnowledgeBaseClient + from griptape.tools import GriptapeCloudKnowledgeBaseTool mock_response = mocker.Mock() mock_response.json.return_value = {} mock_response.status_code = 404 mocker.patch("requests.get", return_value=mock_response) - return GriptapeCloudKnowledgeBaseClient( + return GriptapeCloudKnowledgeBaseTool( base_url="https://api.griptape.ai", api_key="foo bar", knowledge_base_id="1" ) @pytest.fixture() def client_kb_error(self, mocker): - from griptape.tools import GriptapeCloudKnowledgeBaseClient + from griptape.tools import GriptapeCloudKnowledgeBaseTool mock_response = mocker.Mock() mock_response.status_code = 500 mocker.patch("requests.post", return_value=mock_response, side_effect=exceptions.RequestException("error")) - return GriptapeCloudKnowledgeBaseClient( + return GriptapeCloudKnowledgeBaseTool( base_url="https://api.griptape.ai", api_key="foo bar", knowledge_base_id="1" ) @@ -75,7 +75,7 @@ def test_get_knowledge_base_description(self, client): assert client._get_knowledge_base_description() == "foo bar" def test_get_knowledge_base_description_error(self, client_no_description): - exception_match_text = f"No description found for Knowledge Base {client_no_description.knowledge_base_id}. Please set a description, or manually set the `GriptapeCloudKnowledgeBaseClient.description` attribute." + exception_match_text = f"No description found for Knowledge Base {client_no_description.knowledge_base_id}. Please set a description, or manually set the `GriptapeCloudKnowledgeBaseTool.description` attribute." with pytest.raises(ValueError, match=exception_match_text): client_no_description._get_knowledge_base_description() diff --git a/tests/unit/tools/test_inpainting_image_generation_client.py b/tests/unit/tools/test_inpainting_image_generation_tool.py similarity index 87% rename from tests/unit/tools/test_inpainting_image_generation_client.py rename to tests/unit/tools/test_inpainting_image_generation_tool.py index 0c5e49f9a..45afcbc63 100644 --- a/tests/unit/tools/test_inpainting_image_generation_client.py +++ b/tests/unit/tools/test_inpainting_image_generation_tool.py @@ -6,10 +6,10 @@ import pytest from griptape.artifacts import ImageArtifact -from griptape.tools import InpaintingImageGenerationClient +from griptape.tools import InpaintingImageGenerationTool -class TestInpaintingImageGenerationClient: +class TestInpaintingImageGenerationTool: @pytest.fixture() def image_artifact(self) -> ImageArtifact: return ImageArtifact(value=b"image_data", format="png", width=512, height=512, name="name") @@ -26,12 +26,12 @@ def image_loader(self) -> Mock: return loader @pytest.fixture() - def image_generator(self, image_generation_engine, image_loader) -> InpaintingImageGenerationClient: - return InpaintingImageGenerationClient(engine=image_generation_engine, image_loader=image_loader) + def image_generator(self, image_generation_engine, image_loader) -> InpaintingImageGenerationTool: + return InpaintingImageGenerationTool(engine=image_generation_engine, image_loader=image_loader) def test_validate_output_configs(self, image_generation_engine) -> None: with pytest.raises(ValueError): - InpaintingImageGenerationClient(engine=image_generation_engine, output_dir="test", output_file="test") + InpaintingImageGenerationTool(engine=image_generation_engine, output_dir="test", output_file="test") def test_image_inpainting(self, image_generator, path_from_resource_path) -> None: image_generator.engine.run.return_value = Mock( @@ -55,7 +55,7 @@ def test_image_inpainting_with_outfile( self, image_generation_engine, image_loader, path_from_resource_path ) -> None: outfile = f"{tempfile.gettempdir()}/{str(uuid.uuid4())}.png" - image_generator = InpaintingImageGenerationClient( + image_generator = InpaintingImageGenerationTool( engine=image_generation_engine, output_file=outfile, image_loader=image_loader ) @@ -78,7 +78,7 @@ def test_image_inpainting_with_outfile( assert os.path.exists(outfile) def test_image_inpainting_from_memory(self, image_generation_engine, image_artifact): - image_generator = InpaintingImageGenerationClient(engine=image_generation_engine) + image_generator = InpaintingImageGenerationTool(engine=image_generation_engine) memory = Mock() memory.load_artifacts = Mock(return_value=[image_artifact]) image_generator.find_input_memory = Mock(return_value=memory) diff --git a/tests/unit/tools/test_openweather_client.py b/tests/unit/tools/test_openweather_tool.py similarity index 92% rename from tests/unit/tools/test_openweather_client.py rename to tests/unit/tools/test_openweather_tool.py index 89b80e164..44acaf571 100644 --- a/tests/unit/tools/test_openweather_client.py +++ b/tests/unit/tools/test_openweather_tool.py @@ -3,12 +3,12 @@ import pytest from griptape.artifacts import ErrorArtifact -from griptape.tools import OpenWeatherClient +from griptape.tools import OpenWeatherTool @pytest.fixture() def client(): - return OpenWeatherClient(api_key="YOUR_API_KEY") + return OpenWeatherTool(api_key="YOUR_API_KEY") class MockResponse: @@ -21,9 +21,9 @@ def json(self): def mock_requests_get(*args, **kwargs): - if args[0] == OpenWeatherClient.GEOCODING_URL: + if args[0] == OpenWeatherTool.GEOCODING_URL: return MockResponse([{"lat": 40.7128, "lon": -74.0061}], 200) - elif args[0] == OpenWeatherClient.BASE_URL: + elif args[0] == OpenWeatherTool.BASE_URL: return MockResponse({"weather": "sunny"}, 200) return MockResponse(None, 404) diff --git a/tests/unit/tools/test_outpainting_image_variation_client.py b/tests/unit/tools/test_outpainting_image_variation_tool.py similarity index 87% rename from tests/unit/tools/test_outpainting_image_variation_client.py rename to tests/unit/tools/test_outpainting_image_variation_tool.py index 13d8df082..4fbcbe8d4 100644 --- a/tests/unit/tools/test_outpainting_image_variation_client.py +++ b/tests/unit/tools/test_outpainting_image_variation_tool.py @@ -6,10 +6,10 @@ import pytest from griptape.artifacts import ImageArtifact -from griptape.tools import OutpaintingImageGenerationClient +from griptape.tools import OutpaintingImageGenerationTool -class TestOutpaintingImageGenerationClient: +class TestOutpaintingImageGenerationTool: @pytest.fixture() def image_artifact(self) -> ImageArtifact: return ImageArtifact(value=b"image_data", format="png", width=512, height=512, name="name") @@ -26,12 +26,12 @@ def image_loader(self, image_artifact) -> Mock: return loader @pytest.fixture() - def image_generator(self, image_generation_engine, image_loader) -> OutpaintingImageGenerationClient: - return OutpaintingImageGenerationClient(engine=image_generation_engine, image_loader=image_loader) + def image_generator(self, image_generation_engine, image_loader) -> OutpaintingImageGenerationTool: + return OutpaintingImageGenerationTool(engine=image_generation_engine, image_loader=image_loader) def test_validate_output_configs(self, image_generation_engine) -> None: with pytest.raises(ValueError): - OutpaintingImageGenerationClient(engine=image_generation_engine, output_dir="test", output_file="test") + OutpaintingImageGenerationTool(engine=image_generation_engine, output_dir="test", output_file="test") def test_image_outpainting(self, image_generator, path_from_resource_path) -> None: image_generator.engine.run.return_value = Mock( @@ -55,7 +55,7 @@ def test_image_outpainting_with_outfile( self, image_generation_engine, image_loader, path_from_resource_path ) -> None: outfile = f"{tempfile.gettempdir()}/{str(uuid.uuid4())}.png" - image_generator = OutpaintingImageGenerationClient( + image_generator = OutpaintingImageGenerationTool( engine=image_generation_engine, output_file=outfile, image_loader=image_loader ) @@ -78,7 +78,7 @@ def test_image_outpainting_with_outfile( assert os.path.exists(outfile) def test_image_outpainting_from_memory(self, image_generation_engine, image_artifact): - image_generator = OutpaintingImageGenerationClient(engine=image_generation_engine) + image_generator = OutpaintingImageGenerationTool(engine=image_generation_engine) memory = Mock() memory.load_artifacts = Mock(return_value=[image_artifact]) image_generator.find_input_memory = Mock(return_value=memory) diff --git a/tests/unit/tools/test_prompt_image_generation_client.py b/tests/unit/tools/test_prompt_image_generation_tool.py similarity index 77% rename from tests/unit/tools/test_prompt_image_generation_client.py rename to tests/unit/tools/test_prompt_image_generation_tool.py index 276e33473..a0c5c7037 100644 --- a/tests/unit/tools/test_prompt_image_generation_client.py +++ b/tests/unit/tools/test_prompt_image_generation_tool.py @@ -5,21 +5,21 @@ import pytest -from griptape.tools import PromptImageGenerationClient +from griptape.tools import PromptImageGenerationTool -class TestPromptImageGenerationClient: +class TestPromptImageGenerationTool: @pytest.fixture() def image_generation_engine(self) -> Mock: return Mock() @pytest.fixture() - def image_generator(self, image_generation_engine) -> PromptImageGenerationClient: - return PromptImageGenerationClient(engine=image_generation_engine) + def image_generator(self, image_generation_engine) -> PromptImageGenerationTool: + return PromptImageGenerationTool(engine=image_generation_engine) def test_validate_output_configs(self, image_generation_engine) -> None: with pytest.raises(ValueError): - PromptImageGenerationClient(engine=image_generation_engine, output_dir="test", output_file="test") + PromptImageGenerationTool(engine=image_generation_engine, output_dir="test", output_file="test") def test_generate_image(self, image_generator) -> None: image_generator.engine.run.return_value = Mock( @@ -34,7 +34,7 @@ def test_generate_image(self, image_generator) -> None: def test_generate_image_with_outfile(self, image_generation_engine) -> None: outfile = f"{tempfile.gettempdir()}/{str(uuid.uuid4())}.png" - image_generator = PromptImageGenerationClient(engine=image_generation_engine, output_file=outfile) + image_generator = PromptImageGenerationTool(engine=image_generation_engine, output_file=outfile) image_generator.engine.run.return_value = Mock( # pyright: ignore[reportFunctionMemberAccess] value=b"image data", format="png", width=512, height=512, model="test model", prompt="test prompt" diff --git a/tests/unit/tools/test_rag_client.py b/tests/unit/tools/test_rag_tool.py similarity index 72% rename from tests/unit/tools/test_rag_client.py rename to tests/unit/tools/test_rag_tool.py index 60a0df722..eb1c00e4c 100644 --- a/tests/unit/tools/test_rag_client.py +++ b/tests/unit/tools/test_rag_tool.py @@ -1,13 +1,13 @@ from griptape.drivers import LocalVectorStoreDriver -from griptape.tools import RagClient +from griptape.tools import RagTool from tests.mocks.mock_embedding_driver import MockEmbeddingDriver from tests.mocks.mock_prompt_driver import MockPromptDriver from tests.utils.defaults import rag_engine -class TestRagClient: +class TestRagTool: def test_search(self): vector_store_driver = LocalVectorStoreDriver(embedding_driver=MockEmbeddingDriver()) - tool = RagClient(description="Test", rag_engine=rag_engine(MockPromptDriver(), vector_store_driver)) + tool = RagTool(description="Test", rag_engine=rag_engine(MockPromptDriver(), vector_store_driver)) assert tool.search({"values": {"query": "test"}}).value[0].value == "mock output" diff --git a/tests/unit/tools/test_rest_api_client.py b/tests/unit/tools/test_rest_api_tool.py similarity index 92% rename from tests/unit/tools/test_rest_api_client.py rename to tests/unit/tools/test_rest_api_tool.py index 58f21d1f1..70d63478e 100644 --- a/tests/unit/tools/test_rest_api_client.py +++ b/tests/unit/tools/test_rest_api_tool.py @@ -6,9 +6,9 @@ class TestRestApi: @pytest.fixture() def client(self): - from griptape.tools import RestApiClient + from griptape.tools import RestApiTool - return RestApiClient(base_url="http://www.griptape.ai", description="Griptape website.") + return RestApiTool(base_url="http://www.griptape.ai", description="Griptape website.") def test_put(self, client): assert isinstance(client.post({"values": {"body": {}}}), BaseArtifact) diff --git a/tests/unit/tools/test_sql_client.py b/tests/unit/tools/test_sql_tool.py similarity index 87% rename from tests/unit/tools/test_sql_client.py rename to tests/unit/tools/test_sql_tool.py index 8ab61fc8f..2ef50ff54 100644 --- a/tests/unit/tools/test_sql_client.py +++ b/tests/unit/tools/test_sql_tool.py @@ -4,10 +4,10 @@ from griptape.drivers import SqlDriver from griptape.loaders import SqlLoader -from griptape.tools import SqlClient +from griptape.tools import SqlTool -class TestSqlClient: +class TestSqlTool: @pytest.fixture() def driver(self): new_driver = SqlDriver(engine_url="sqlite:///:memory:") @@ -22,14 +22,14 @@ def driver(self): def test_execute_query(self, driver): with sqlite3.connect(":memory:"): - client = SqlClient(sql_loader=SqlLoader(sql_driver=driver), table_name="test_table", engine_name="sqlite") + client = SqlTool(sql_loader=SqlLoader(sql_driver=driver), table_name="test_table", engine_name="sqlite") result = client.execute_query({"values": {"sql_query": "SELECT * from test_table;"}}) assert len(result.value) == 1 assert result.value[0].value == {"id": 1, "name": "Alice", "age": 25, "city": "New York"} def test_execute_query_description(self, driver): - client = SqlClient( + client = SqlTool( sql_loader=SqlLoader(sql_driver=driver), table_name="test_table", table_description="foobar", diff --git a/tests/unit/tools/test_structure_run_client.py b/tests/unit/tools/test_structure_run_tool.py similarity index 82% rename from tests/unit/tools/test_structure_run_client.py rename to tests/unit/tools/test_structure_run_tool.py index ee76d4da1..f62cdeea7 100644 --- a/tests/unit/tools/test_structure_run_client.py +++ b/tests/unit/tools/test_structure_run_tool.py @@ -2,15 +2,15 @@ from griptape.drivers.structure_run.local_structure_run_driver import LocalStructureRunDriver from griptape.structures import Agent -from griptape.tools import StructureRunClient +from griptape.tools import StructureRunTool -class TestStructureRunClient: +class TestStructureRunTool: @pytest.fixture() def client(self): agent = Agent() - return StructureRunClient( + return StructureRunTool( description="foo bar", driver=LocalStructureRunDriver(structure_factory_fn=lambda: agent) ) diff --git a/tests/unit/tools/test_task_memory_client.py b/tests/unit/tools/test_task_memory_tool.py similarity index 80% rename from tests/unit/tools/test_task_memory_client.py rename to tests/unit/tools/test_task_memory_tool.py index 4276b89ec..238001d55 100644 --- a/tests/unit/tools/test_task_memory_client.py +++ b/tests/unit/tools/test_task_memory_tool.py @@ -1,14 +1,14 @@ import pytest from griptape.artifacts import TextArtifact -from griptape.tools import TaskMemoryClient +from griptape.tools import TaskMemoryTool from tests.utils import defaults -class TestTaskMemoryClient: +class TestTaskMemoryTool: @pytest.fixture() def tool(self): - return TaskMemoryClient(off_prompt=True, input_memory=[defaults.text_task_memory("TestMemory")]) + return TaskMemoryTool(off_prompt=True, input_memory=[defaults.text_task_memory("TestMemory")]) def test_summarize(self, tool): tool.input_memory[0].store_artifact("foo", TextArtifact("test")) diff --git a/tests/unit/tools/test_text_to_speech_client.py b/tests/unit/tools/test_text_to_speech_tool.py similarity index 74% rename from tests/unit/tools/test_text_to_speech_client.py rename to tests/unit/tools/test_text_to_speech_tool.py index 0b9061aa6..8821d48fc 100644 --- a/tests/unit/tools/test_text_to_speech_client.py +++ b/tests/unit/tools/test_text_to_speech_tool.py @@ -5,21 +5,21 @@ import pytest -from griptape.tools.text_to_speech_client.tool import TextToSpeechClient +from griptape.tools.text_to_speech.tool import TextToSpeechTool -class TestTextToSpeechClient: +class TestTextToSpeechTool: @pytest.fixture() def text_to_speech_engine(self) -> Mock: return Mock() @pytest.fixture() - def text_to_speech_client(self, text_to_speech_engine) -> TextToSpeechClient: - return TextToSpeechClient(engine=text_to_speech_engine) + def text_to_speech_client(self, text_to_speech_engine) -> TextToSpeechTool: + return TextToSpeechTool(engine=text_to_speech_engine) def test_validate_output_configs(self, text_to_speech_engine) -> None: with pytest.raises(ValueError): - TextToSpeechClient(engine=text_to_speech_engine, output_dir="test", output_file="test") + TextToSpeechTool(engine=text_to_speech_engine, output_dir="test", output_file="test") def test_text_to_speech(self, text_to_speech_client) -> None: text_to_speech_client.engine.run.return_value = Mock(value=b"audio data", format="mp3") @@ -30,7 +30,7 @@ def test_text_to_speech(self, text_to_speech_client) -> None: def test_text_to_speech_with_outfile(self, text_to_speech_engine) -> None: outfile = f"{tempfile.gettempdir()}/{str(uuid.uuid4())}.mp3" - text_to_speech_client = TextToSpeechClient(engine=text_to_speech_engine, output_file=outfile) + text_to_speech_client = TextToSpeechTool(engine=text_to_speech_engine, output_file=outfile) text_to_speech_client.engine.run.return_value = Mock(value=b"audio data", format="mp3") # pyright: ignore[reportFunctionMemberAccess] diff --git a/tests/unit/tools/test_transcription_client.py b/tests/unit/tools/test_transcription_tool.py similarity index 83% rename from tests/unit/tools/test_transcription_client.py rename to tests/unit/tools/test_transcription_tool.py index 8b54e891b..07368495f 100644 --- a/tests/unit/tools/test_transcription_client.py +++ b/tests/unit/tools/test_transcription_tool.py @@ -3,10 +3,10 @@ import pytest from griptape.artifacts import AudioArtifact -from griptape.tools.audio_transcription_client.tool import AudioTranscriptionClient +from griptape.tools.audio_transcription.tool import AudioTranscriptionTool -class TestTranscriptionClient: +class TestTranscriptionTool: @pytest.fixture() def transcription_engine(self) -> Mock: return Mock() @@ -27,11 +27,11 @@ def mock_path(self, mocker) -> Mock: return mocker def test_init_transcription_client(self, transcription_engine, audio_loader) -> None: - assert AudioTranscriptionClient(engine=transcription_engine, audio_loader=audio_loader) + assert AudioTranscriptionTool(engine=transcription_engine, audio_loader=audio_loader) @patch("builtins.open", mock_open(read_data=b"audio data")) def test_transcribe_audio_from_disk(self, transcription_engine, audio_loader) -> None: - client = AudioTranscriptionClient(engine=transcription_engine, audio_loader=audio_loader) + client = AudioTranscriptionTool(engine=transcription_engine, audio_loader=audio_loader) client.engine.run.return_value = Mock(value="transcription") # pyright: ignore[reportFunctionMemberAccess] text_artifact = client.transcribe_audio_from_disk(params={"values": {"path": "audio.wav"}}) @@ -40,7 +40,7 @@ def test_transcribe_audio_from_disk(self, transcription_engine, audio_loader) -> assert text_artifact.value == "transcription" def test_transcribe_audio_from_memory(self, transcription_engine, audio_loader) -> None: - client = AudioTranscriptionClient(engine=transcription_engine, audio_loader=audio_loader) + client = AudioTranscriptionTool(engine=transcription_engine, audio_loader=audio_loader) memory = Mock() memory.load_artifacts = Mock(return_value=[AudioArtifact(value=b"audio data", format="wav", name="name")]) client.find_input_memory = Mock(return_value=memory) diff --git a/tests/unit/tools/test_variation_image_generation_client.py b/tests/unit/tools/test_variation_image_generation_tool.py similarity index 88% rename from tests/unit/tools/test_variation_image_generation_client.py rename to tests/unit/tools/test_variation_image_generation_tool.py index 0db454f92..c4528a044 100644 --- a/tests/unit/tools/test_variation_image_generation_client.py +++ b/tests/unit/tools/test_variation_image_generation_tool.py @@ -6,10 +6,10 @@ import pytest from griptape.artifacts import ImageArtifact -from griptape.tools import VariationImageGenerationClient +from griptape.tools import VariationImageGenerationTool -class TestVariationImageGenerationClient: +class TestVariationImageGenerationTool: @pytest.fixture() def image_artifact(self) -> ImageArtifact: return ImageArtifact(value=b"image_data", format="png", width=512, height=512, name="name") @@ -26,12 +26,12 @@ def image_loader(self) -> Mock: return loader @pytest.fixture() - def image_generator(self, image_generation_engine, image_loader) -> VariationImageGenerationClient: - return VariationImageGenerationClient(engine=image_generation_engine, image_loader=image_loader) + def image_generator(self, image_generation_engine, image_loader) -> VariationImageGenerationTool: + return VariationImageGenerationTool(engine=image_generation_engine, image_loader=image_loader) def test_validate_output_configs(self, image_generation_engine, image_loader) -> None: with pytest.raises(ValueError): - VariationImageGenerationClient( + VariationImageGenerationTool( engine=image_generation_engine, output_dir="test", output_file="test", image_loader=image_loader ) @@ -54,7 +54,7 @@ def test_image_variation(self, image_generator, path_from_resource_path) -> None def test_image_variation_with_outfile(self, image_generation_engine, image_loader, path_from_resource_path) -> None: outfile = f"{tempfile.gettempdir()}/{str(uuid.uuid4())}.png" - image_generator = VariationImageGenerationClient( + image_generator = VariationImageGenerationTool( engine=image_generation_engine, output_file=outfile, image_loader=image_loader ) @@ -76,7 +76,7 @@ def test_image_variation_with_outfile(self, image_generation_engine, image_loade assert os.path.exists(outfile) def test_image_variation_from_memory(self, image_generation_engine, image_artifact): - image_generator = VariationImageGenerationClient(engine=image_generation_engine) + image_generator = VariationImageGenerationTool(engine=image_generation_engine) memory = Mock() memory.load_artifacts = Mock(return_value=[image_artifact]) image_generator.find_input_memory = Mock(return_value=memory) diff --git a/tests/unit/tools/test_vector_store_client.py b/tests/unit/tools/test_vector_store_tool.py similarity index 78% rename from tests/unit/tools/test_vector_store_client.py rename to tests/unit/tools/test_vector_store_tool.py index b02dda226..ea52a13ea 100644 --- a/tests/unit/tools/test_vector_store_client.py +++ b/tests/unit/tools/test_vector_store_tool.py @@ -2,18 +2,18 @@ from griptape.artifacts import ListArtifact, TextArtifact from griptape.drivers import LocalVectorStoreDriver -from griptape.tools import VectorStoreClient +from griptape.tools import VectorStoreTool from tests.mocks.mock_embedding_driver import MockEmbeddingDriver -class TestVectorStoreClient: +class TestVectorStoreTool: @pytest.fixture(autouse=True) def _mock_try_run(self, mocker): mocker.patch("griptape.drivers.OpenAiEmbeddingDriver.try_embed_chunk", return_value=[0, 1]) def test_search(self): driver = LocalVectorStoreDriver(embedding_driver=MockEmbeddingDriver()) - tool = VectorStoreClient(description="Test", vector_store_driver=driver) + tool = VectorStoreTool(description="Test", vector_store_driver=driver) driver.upsert_text_artifacts({"test": [TextArtifact("foo"), TextArtifact("bar")]}) @@ -21,8 +21,8 @@ def test_search(self): def test_search_with_namespace(self): driver = LocalVectorStoreDriver(embedding_driver=MockEmbeddingDriver()) - tool1 = VectorStoreClient(description="Test", vector_store_driver=driver, query_params={"namespace": "test"}) - tool2 = VectorStoreClient(description="Test", vector_store_driver=driver, query_params={"namespace": "test2"}) + tool1 = VectorStoreTool(description="Test", vector_store_driver=driver, query_params={"namespace": "test"}) + tool2 = VectorStoreTool(description="Test", vector_store_driver=driver, query_params={"namespace": "test2"}) driver.upsert_text_artifacts({"test": [TextArtifact("foo"), TextArtifact("bar")]}) @@ -31,7 +31,7 @@ def test_search_with_namespace(self): def test_custom_process_query_output_fn(self): driver = LocalVectorStoreDriver(embedding_driver=MockEmbeddingDriver()) - tool1 = VectorStoreClient( + tool1 = VectorStoreTool( description="Test", vector_store_driver=driver, process_query_output_fn=lambda es: ListArtifact([e.vector for e in es]), diff --git a/tests/unit/tools/test_web_scraper.py b/tests/unit/tools/test_web_scraper.py index 30362ce65..0fdc761b4 100644 --- a/tests/unit/tools/test_web_scraper.py +++ b/tests/unit/tools/test_web_scraper.py @@ -6,9 +6,9 @@ class TestWebScraper: @pytest.fixture() def scraper(self): - from griptape.tools import WebScraper + from griptape.tools import WebScraperTool - return WebScraper() + return WebScraperTool() def test_get_content(self, scraper): assert isinstance( diff --git a/tests/unit/tools/test_web_search.py b/tests/unit/tools/test_web_search.py index 17ff610e0..c1f9555ea 100644 --- a/tests/unit/tools/test_web_search.py +++ b/tests/unit/tools/test_web_search.py @@ -1,7 +1,7 @@ import pytest from griptape.artifacts import BaseArtifact, ErrorArtifact, TextArtifact -from griptape.tools import WebSearch +from griptape.tools import WebSearchTool class TestWebSearch: @@ -11,7 +11,7 @@ def websearch_tool(self, mocker): driver = mocker.Mock() mocker.patch.object(driver, "search", return_value=mock_response) - return WebSearch(web_search_driver=driver) + return WebSearchTool(web_search_driver=driver) @pytest.fixture() def websearch_tool_with_error(self, mocker): @@ -19,7 +19,7 @@ def websearch_tool_with_error(self, mocker): driver = mocker.Mock() mocker.patch.object(driver, "search", side_effect=mock_response) - return WebSearch(web_search_driver=driver) + return WebSearchTool(web_search_driver=driver) def test_search(self, websearch_tool): assert isinstance(websearch_tool.search({"values": {"query": "foo bar"}}), BaseArtifact)