diff --git a/CHANGELOG.md b/CHANGELOG.md index 76a2cdf74..a4b0b0e04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING**: Changed `CsvExtractionEngine.column_names` from a `run` argument to a class attribute. - **BREAKING**: Removed `JsonExtractionTask`, and `CsvExtractionTask` use `ExtractionTask` instead. - **BREAKING**: Removed `TaskMemoryClient`, use `RagClient`, `ExtractionTool`, or `PromptSummaryClient` instead. +- **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. - `RagClient` now can be used to search through Artifacts stored in Task Memory. - 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 e10c58f98..bc82e645d 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, PromptSummaryTool +from griptape.tools import WebScraperTool, FileManagerTool, PromptSummaryTool agent = Agent( input="Load {{ args[0] }}, summarize it, and store it in a file called {{ args[1] }}.", tools=[ - WebScraper(off_prompt=True), + WebScraperTool(off_prompt=True), PromptSummaryTool(off_prompt=True), - FileManager() + FileManagerTool() ] ) agent.run("https://griptape.ai", "griptape.txt") @@ -110,7 +110,7 @@ And here is the output: Actions: [ { "tag": "call_62kBnkswnk9Y6GH6kn1GIKk6", - "name": "WebScraper", + "name": "WebScraperTool", "path": "get_content", "input": { "values": { @@ -120,7 +120,7 @@ And here is the output: } ] [08/12/24 14:48:17] INFO Subtask ebe23832cbe2464fb9ecde9fcee7c30f - Response: Output of "WebScraper.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "WebScraperTool.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace "cecca28eb0c74bcd8c7119ed7f790c95" [08/12/24 14:48:18] INFO Subtask dca04901436d49d2ade86cd6b4e1038a Actions: [ @@ -145,7 +145,7 @@ And here is the output: Actions: [ { "tag": "call_eKvIUIw45aRYKDBpT1gGKc9b", - "name": "FileManager", + "name": "FileManagerTool", "path": "save_memory_artifacts_to_disk", "input": { "values": { 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 de4c256e0..e1f00a9bd 100644 --- a/docs/examples/src/multi_agent_workflow_1.py +++ b/docs/examples/src/multi_agent_workflow_1.py @@ -6,8 +6,8 @@ from griptape.tasks import PromptTask, StructureRunTask from griptape.tools import ( PromptSummaryTool, - WebScraper, - WebSearch, + WebScraperTool, + WebSearchTool, ) WRITERS = [ @@ -29,13 +29,13 @@ 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, ), PromptSummaryTool(off_prompt=False), diff --git a/docs/examples/src/multiple_agent_shared_memory_1.py b/docs/examples/src/multiple_agent_shared_memory_1.py index 2864dd04e..3f2222932 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 QueryTool, WebScraper +from griptape.tools import QueryTool, WebScraperTool AZURE_OPENAI_ENDPOINT_1 = os.environ["AZURE_OPENAI_ENDPOINT_1"] AZURE_OPENAI_API_KEY_1 = os.environ["AZURE_OPENAI_API_KEY_1"] @@ -41,7 +41,7 @@ loader = Agent( tools=[ - WebScraper(off_prompt=True), + WebScraperTool(off_prompt=True), ], ) asker = Agent( diff --git a/docs/examples/src/query_webpage_astra_db_1.py b/docs/examples/src/query_webpage_astra_db_1.py index 38c458567..3309e1dcd 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 QueryTool, RagClient +from griptape.tools import RagTool 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, QueryTool(off_prompt=False)]) +agent = Agent(tools=[rag_tool]) 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 b11871c67..f7359ffef 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 PromptSummaryTool, WebScraper +from griptape.tools import PromptSummaryTool, WebScraperTool config.drivers = DriverConfig( prompt=OpenAiChatPromptDriver(model="gpt-4o"), @@ -17,7 +17,7 @@ ) agent = Agent( - tools=[WebScraper(off_prompt=True), PromptSummaryTool(off_prompt=False)], + tools=[WebScraperTool(off_prompt=True), PromptSummaryTool(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 6ccb0dafd..aafa465f8 100644 --- a/docs/griptape-framework/drivers/src/web_scraper_drivers_3.py +++ b/docs/griptape-framework/drivers/src/web_scraper_drivers_3.py @@ -1,13 +1,13 @@ from griptape.drivers import MarkdownifyWebScraperDriver from griptape.loaders import WebLoader from griptape.structures import Agent -from griptape.tools import WebScraper +from griptape.tools import WebScraperTool agent = Agent( tools=[ - WebScraper( + WebScraperTool( web_loader=WebLoader(web_scraper_driver=MarkdownifyWebScraperDriver(timeout=1000)), - off_prompt=True, + off_prompt=False, ), ], ) 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 2b92f0017..abe80a2e0 100644 --- a/docs/griptape-framework/drivers/src/web_search_drivers_2.py +++ b/docs/griptape-framework/drivers/src/web_search_drivers_2.py @@ -2,11 +2,11 @@ from griptape.drivers import GoogleWebSearchDriver from griptape.structures import Agent -from griptape.tools import PromptSummaryTool, WebSearch +from griptape.tools import PromptSummaryTool, 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-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 9fd4c18ac..4b0d7dac2 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": { @@ -134,7 +134,7 @@ Agents are great for getting started, but they are intentionally limited to a si Actions: [ { "tag": "call_YL5Ozd9WUtag4ykR5Agm12Ce", - "name": "WebScraper", + "name": "WebScraperTool", "path": "get_content", "input": { "values": { @@ -144,7 +144,7 @@ Agents are great for getting started, but they are intentionally limited to a si } ] [08/12/24 14:50:31] INFO Subtask a685799379c5421b91768353fc219939 - Response: Output of "WebScraper.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "WebScraperTool.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace "6be3a2e0494841fda966b98bec9ffccb" [08/12/24 14:50:33] INFO Subtask 1cf0c19843aa4fada5745c4a82eb4237 Actions: [ @@ -175,7 +175,7 @@ Agents are great for getting started, but they are intentionally limited to a si Actions: [ { "tag": "call_eKvIUIw45aRYKDBpT1gGKc9b", - "name": "FileManager", + "name": "FileManagerTool", "path": "save_content_to_file", "input": { "values": { diff --git a/docs/griptape-framework/misc/src/events_3.py b/docs/griptape-framework/misc/src/events_3.py index 291e6dd7c..721cf3511 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 PromptSummaryTool, WebScraper +from griptape.tools import PromptSummaryTool, 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), PromptSummaryTool(off_prompt=False)], + tools=[WebScraperTool(off_prompt=True), PromptSummaryTool(off_prompt=False)], ) ) diff --git a/docs/griptape-framework/misc/src/events_4.py b/docs/griptape-framework/misc/src/events_4.py index b20e86f60..6dc2d3a6c 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 PromptSummaryTool, WebScraper +from griptape.tools import PromptSummaryTool, 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), PromptSummaryTool(off_prompt=False)], + tools=[WebScraperTool(off_prompt=True), PromptSummaryTool(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 48d602b17..50465f99e 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, PromptSummaryTool, WebScraper +from griptape.tools import FileManagerTool, PromptSummaryTool, 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), PromptSummaryTool(off_prompt=False)], + tools=[WebScraperTool(off_prompt=True), FileManagerTool(off_prompt=True), PromptSummaryTool(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 c7d0617fd..8a0e53d8c 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, PromptSummaryTool +from griptape.tools import CalculatorTool, PromptSummaryTool # Create an agent with the Calculator tool -agent = Agent(tools=[Calculator(off_prompt=True), PromptSummaryTool(off_prompt=False)]) +agent = Agent(tools=[CalculatorTool(off_prompt=True), PromptSummaryTool(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 a3052ab5a..a061118e8 100644 --- a/docs/griptape-framework/structures/src/task_memory_5.py +++ b/docs/griptape-framework/structures/src/task_memory_5.py @@ -1,9 +1,9 @@ from griptape.structures import Agent -from griptape.tools import QueryTool, WebScraper +from griptape.tools import QueryTool, WebScraperTool agent = Agent( tools=[ - WebScraper(off_prompt=True), + WebScraperTool(off_prompt=True), QueryTool(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 c92f30261..ddd4809b6 100644 --- a/docs/griptape-framework/structures/src/task_memory_6.py +++ b/docs/griptape-framework/structures/src/task_memory_6.py @@ -11,7 +11,7 @@ from griptape.memory import TaskMemory from griptape.memory.task.storage import TextArtifactStorage from griptape.structures import Agent -from griptape.tools import FileManager, QueryTool, WebScraper +from griptape.tools import FileManagerTool, QueryTool, WebScraperTool config.drivers = OpenAiDriverConfig( prompt=OpenAiChatPromptDriver(model="gpt-4"), @@ -32,9 +32,9 @@ } ), tools=[ - WebScraper(off_prompt=True), + WebScraperTool(off_prompt=True), QueryTool(off_prompt=True), - FileManager(off_prompt=True), + 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 a6e66308c..ee106caec 100644 --- a/docs/griptape-framework/structures/src/task_memory_8.py +++ b/docs/griptape-framework/structures/src/task_memory_8.py @@ -1,9 +1,9 @@ from griptape.structures import Agent -from griptape.tools import PromptSummaryTool, WebScraper +from griptape.tools import PromptSummaryTool, WebScraperTool agent = Agent( tools=[ - WebScraper(off_prompt=True), # This tool will store the data in Task Memory + WebScraperTool(off_prompt=True), # This tool will store the data in Task Memory PromptSummaryTool( off_prompt=True ), # This tool will store the data back in Task Memory with no way to get it out 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 6c6ab87f5..a6da835a6 100644 --- a/docs/griptape-framework/structures/src/tasks_16.py +++ b/docs/griptape-framework/structures/src/tasks_16.py @@ -6,21 +6,21 @@ from griptape.tasks import StructureRunTask from griptape.tools import ( PromptSummaryTool, - WebScraper, - WebSearch, + 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, ), PromptSummaryTool(off_prompt=False), diff --git a/docs/griptape-framework/structures/src/tasks_4.py b/docs/griptape-framework/structures/src/tasks_4.py index 02d21016a..cd73b3ada 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, PromptSummaryTool, WebScraper +from griptape.tools import FileManagerTool, PromptSummaryTool, 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), PromptSummaryTool(off_prompt=True)], + tools=[WebScraperTool(off_prompt=True), FileManagerTool(off_prompt=True), PromptSummaryTool(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 094f20948..59fc2000a 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,22 +49,22 @@ 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... ``` @@ -125,7 +125,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 @@ -158,7 +158,7 @@ And now we get the expected output: Actions: [ { "tag": "call_DGsOHC4AVxhV7RPVA7q3rATX", - "name": "WebScraper", + "name": "WebScraperTool", "path": "get_content", "input": { "values": { @@ -168,7 +168,7 @@ And now we get the expected output: } ] [08/12/24 14:56:25] INFO Subtask 494850ec40fe474c83d48b5620c5dcbb - Response: Output of "WebScraper.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "WebScraperTool.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace "b9f53d6d9b35455aaf4d99719c1bfffa" [08/12/24 14:56:26] INFO Subtask 8669ee523bb64550850566011bcd14e2 Actions: [ @@ -199,7 +199,7 @@ And now we get the expected output: Because Task Memory splits up the storage and retrieval of data, you can use different models for each step. Here is an example where we use GPT-4 to orchestrate the Tools and store the data in Task Memory, and Amazon Bedrock's Titan model to query the raw content. -In this example, GPT-4 _never_ sees the contents of the page, only that it was stored in Task Memory. Even the query results generated by the Titan model are stored in Task Memory so that the `FileManager` can save the results to disk without GPT-4 ever seeing them. +In this example, GPT-4 _never_ sees the contents of the page, only that it was stored in Task Memory. Even the query results generated by the Titan model are stored in Task Memory so that the `FileManagerTool` can save the results to disk without GPT-4 ever seeing them. ```python --8<-- "docs/griptape-framework/structures/src/task_memory_6.py" @@ -213,7 +213,7 @@ In this example, GPT-4 _never_ sees the contents of the page, only that it was s Actions: [ { "tag": "call_xMK0IyFZFbjlTapK7AA6kbNq", - "name": "WebScraper", + "name": "WebScraperTool", "path": "get_content", "input": { "values": { @@ -223,7 +223,7 @@ In this example, GPT-4 _never_ sees the contents of the page, only that it was s } ] [08/12/24 14:55:28] INFO Subtask 26205b5623174424b618abafd886c4d8 - Response: Output of "WebScraper.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "WebScraperTool.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace "44b8f230645148d0b8d44354c0f2df5b" [08/12/24 14:55:31] INFO Subtask d8b4cf297a0d4d9db04e4f8e63b746c8 Actions: [ @@ -249,7 +249,7 @@ In this example, GPT-4 _never_ sees the contents of the page, only that it was s Actions: [ { "tag": "call_nV1DIPAEhUEAVMCjXND0pKoS", - "name": "FileManager", + "name": "FileManagerTool", "path": "save_memory_artifacts_to_disk", "input": { "values": { @@ -276,7 +276,7 @@ Today, these include: - [PromptSummaryClient](../../griptape-tools/official-tools/prompt-summary-client.md) - [ExtractionTool](../../griptape-tools/official-tools/extraction-client.md) - [RagClient](../../griptape-tools/official-tools/rag-client.md) -- [FileManager](../../griptape-tools/official-tools/file-manager.md) +- [FileManagerTool](../../griptape-tools/official-tools/file-manager.md) ## Task Memory Considerations diff --git a/docs/griptape-framework/structures/tasks.md b/docs/griptape-framework/structures/tasks.md index cef7f653b..2c3c96751 100644 --- a/docs/griptape-framework/structures/tasks.md +++ b/docs/griptape-framework/structures/tasks.md @@ -105,7 +105,7 @@ This Task takes in one or more Tools which the LLM will decide to use through Ch Actions: [ { "tag": "call_AFeOL9MGhZ4mPFCULcBEm4NQ", - "name": "WebScraper", + "name": "WebScraperTool", "path": "get_content", "input": { "values": { @@ -115,7 +115,7 @@ This Task takes in one or more Tools which the LLM will decide to use through Ch } ] INFO Subtask a4483eddfbe84129b0f4c04ef0f5d695 - Response: Output of "WebScraper.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "WebScraperTool.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace "c6a6bcfc16f34481a068108aeaa6838e" [08/12/24 15:16:33] INFO Subtask ee5f11666ded4dc39b94e4c59d18fbc7 Actions: [ @@ -140,7 +140,7 @@ This Task takes in one or more Tools which the LLM will decide to use through Ch Actions: [ { "tag": "call_QgMk1M1UuD6DAnxjfQz1MH6X", - "name": "FileManager", + "name": "FileManagerTool", "path": "save_memory_artifacts_to_disk", "input": { "values": { @@ -173,7 +173,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 727b8f78d..2cc149854 100644 --- a/docs/griptape-framework/tools/index.md +++ b/docs/griptape-framework/tools/index.md @@ -25,7 +25,7 @@ Here is an example of a Pipeline using Tools: Actions: [ { "tag": "call_P6vaURTXfiYBJZolTkUSRHRc", - "name": "WebScraper", + "name": "WebScraperTool", "path": "get_content", "input": { "values": { @@ -35,7 +35,7 @@ Here is an example of a Pipeline using Tools: } ] INFO Subtask 3b8365c077ae4a7e94087bfeff7a858c - Response: Output of "WebScraper.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "WebScraperTool.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace "301e546f4450489ea4680645297092a2" [08/12/24 15:18:21] INFO Subtask 930e9ca52e4140a48cce1e47368d45be Actions: [ @@ -64,7 +64,7 @@ Here is an example of a Pipeline using Tools: Actions: [ { "tag": "call_zdUe2vdR0DCfR6LKcxjI6ayb", - "name": "FileManager", + "name": "FileManagerTool", "path": "save_content_to_file", "input": { "values": { diff --git a/docs/griptape-framework/tools/src/index_1.py b/docs/griptape-framework/tools/src/index_1.py index 1aa2ce0a4..a894e2037 100644 --- a/docs/griptape-framework/tools/src/index_1.py +++ b/docs/griptape-framework/tools/src/index_1.py @@ -1,6 +1,6 @@ from griptape.structures import Pipeline from griptape.tasks import ToolkitTask -from griptape.tools import FileManager, PromptSummaryTool, WebScraper +from griptape.tools import FileManagerTool, PromptSummaryTool, WebScraperTool pipeline = Pipeline() @@ -8,8 +8,8 @@ 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), + WebScraperTool(off_prompt=True), + FileManagerTool(off_prompt=True), PromptSummaryTool(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 97% rename from docs/griptape-tools/official-tools/aws-iam-client.md rename to docs/griptape-tools/official-tools/aws-iam-tool.md index a9b8a816e..8be54afb5 100644 --- a/docs/griptape-tools/official-tools/aws-iam-client.md +++ b/docs/griptape-tools/official-tools/aws-iam-tool.md @@ -1,9 +1,9 @@ -# 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" ``` ``` [08/12/24 14:56:59] INFO ToolkitTask 12345abcd67890efghijk1112131415 diff --git a/docs/griptape-tools/official-tools/aws-s3-client.md b/docs/griptape-tools/official-tools/aws-s3-tool.md similarity index 96% rename from docs/griptape-tools/official-tools/aws-s3-client.md rename to docs/griptape-tools/official-tools/aws-s3-tool.md index 12b292887..c6a972d76 100644 --- a/docs/griptape-tools/official-tools/aws-s3-client.md +++ b/docs/griptape-tools/official-tools/aws-s3-tool.md @@ -1,9 +1,9 @@ -# 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" ``` ``` [08/12/24 14:51:36] INFO ToolkitTask bfc329ebc7d34497b429ab0d18ff7e7b 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 96% rename from docs/griptape-tools/official-tools/computer.md rename to docs/griptape-tools/official-tools/computer-tool.md index b8d2489f0..f21d4bda9 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" ``` ``` ❮ poetry run python src/docs/task-memory.py 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/extraction-client.md b/docs/griptape-tools/official-tools/extraction-client.md index 2812d2ad0..d4dc8aa31 100644 --- a/docs/griptape-tools/official-tools/extraction-client.md +++ b/docs/griptape-tools/official-tools/extraction-client.md @@ -12,7 +12,7 @@ Here is an example of how it can be used with a local vector store driver: Actions: [ { "tag": "call_SgrmWdXaYTQ1Cz9iB0iIZSYD", - "name": "WebScraper", + "name": "WebScraperTool", "path": "get_content", "input": { "values": { @@ -22,7 +22,7 @@ Here is an example of how it can be used with a local vector store driver: } ] [08/12/24 15:58:06] INFO Subtask 6a9a63802faf4717bab24bbbea2cb49b - Response: Output of "WebScraper.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "WebScraperTool.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace "bf1c865b82554c9e896cb514bb86844c" [08/12/24 15:58:07] INFO Subtask c06388d6079541d5aaff25c30e322c51 Actions: [ diff --git a/docs/griptape-tools/official-tools/file-manager.md b/docs/griptape-tools/official-tools/file-manager-tool.md similarity index 89% rename from docs/griptape-tools/official-tools/file-manager.md rename to docs/griptape-tools/official-tools/file-manager-tool.md index 539c4fff4..2c27c86ea 100644 --- a/docs/griptape-tools/official-tools/file-manager.md +++ b/docs/griptape-tools/official-tools/file-manager-tool.md @@ -1,20 +1,20 @@ -# 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 Input: Can you get me the sample1.txt file? [09/12/23 12:08:04] INFO Subtask ddcf48d970ce4edbbc22a46b2f83ec4f Thought: The user wants the content of the file - named "sample1.txt". I can use the FileManager tool + named "sample1.txt". I can use the FileManagerTool tool with the activity "load_files_from_disk" to load the file from the disk. - Action: {"name": "FileManager", + Action: {"name": "FileManagerTool", "path": "load_files_from_disk", "input": {"values": {"paths": ["sample1.txt"]}}} INFO Subtask ddcf48d970ce4edbbc22a46b2f83ec4f 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 a633f975f..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 @@ -# ImageQueryTool +# 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/prompt-summary-client.md b/docs/griptape-tools/official-tools/prompt-summary-client.md index 87575d7bf..16becee8c 100644 --- a/docs/griptape-tools/official-tools/prompt-summary-client.md +++ b/docs/griptape-tools/official-tools/prompt-summary-client.md @@ -12,7 +12,7 @@ Here is an example of how it can be used with a local vector store driver: Actions: [ { "tag": "call_DGsOHC4AVxhV7RPVA7q3rATX", - "name": "WebScraper", + "name": "WebScraperTool", "path": "get_content", "input": { "values": { @@ -22,7 +22,7 @@ Here is an example of how it can be used with a local vector store driver: } ] [08/12/24 15:54:49] INFO Subtask cd362a149e1d400997be93c1342d1663 - Response: Output of "WebScraper.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "WebScraperTool.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace "990b689c57de4581b8715963c0aecfe3" [08/12/24 15:54:50] INFO Subtask 919a4a9eb900439ab9bfbf6e921feba3 Actions: [ diff --git a/docs/griptape-tools/official-tools/query-client.md b/docs/griptape-tools/official-tools/query-client.md index d85174ec4..5728806a2 100644 --- a/docs/griptape-tools/official-tools/query-client.md +++ b/docs/griptape-tools/official-tools/query-client.md @@ -12,7 +12,7 @@ Here is an example of how it can be used with a local vector store driver: Actions: [ { "tag": "call_VY4r5YRc2QDjtBvn89z5PH8E", - "name": "WebScraper", + "name": "WebScraperTool", "path": "get_content", "input": { "values": { @@ -22,7 +22,7 @@ Here is an example of how it can be used with a local vector store driver: } ] [08/12/24 15:49:25] INFO Subtask 3dc9910bcac44c718b3aedd6222e372a - Response: Output of "WebScraper.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "WebScraperTool.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace "bec6deeac5f84e369c41210e67905415" [08/12/24 15:49:26] INFO Subtask f41d2189ecff4458acb8e6dadb5b13aa Actions: [ 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 97% rename from docs/griptape-tools/official-tools/sql-client.md rename to docs/griptape-tools/official-tools/sql-tool.md index 4d8a27fb1..ed8aae2a0 100644 --- a/docs/griptape-tools/official-tools/sql-client.md +++ b/docs/griptape-tools/official-tools/sql-tool.md @@ -1,9 +1,9 @@ -# 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" ``` ``` [08/12/24 14:59:31] INFO ToolkitTask e302f7315d1a4f939e0125103ff4f09f 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 69% 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 c24d283b0..3d9425534 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,10 +1,10 @@ import boto3 from griptape.structures import Agent -from griptape.tools import AwsS3Client +from griptape.tools import AwsS3Tool # 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]) 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 50% rename from docs/griptape-tools/official-tools/src/computer_1.py rename to docs/griptape-tools/official-tools/src/computer_tool_1.py index e7f136532..725210020 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]) agent.run("Make 2 files and then list the files in the current directory") 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/extraction_client_1.py b/docs/griptape-tools/official-tools/src/extraction_client_1.py index d2eccb213..80e211f03 100644 --- a/docs/griptape-tools/official-tools/src/extraction_client_1.py +++ b/docs/griptape-tools/official-tools/src/extraction_client_1.py @@ -2,12 +2,12 @@ from griptape.engines import JsonExtractionEngine from griptape.structures import Agent -from griptape.tools import ExtractionTool, WebScraper +from griptape.tools import ExtractionTool, WebScraperTool agent = Agent( input="Load {{ args[0] }} and extract key info", tools=[ - WebScraper(off_prompt=True), + WebScraperTool(off_prompt=True), ExtractionTool( off_prompt=False, extraction_engine=JsonExtractionEngine( 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 100% 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 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/prompt_summary_client_1.py b/docs/griptape-tools/official-tools/src/prompt_summary_client_1.py index e4740c944..3b4846439 100644 --- a/docs/griptape-tools/official-tools/src/prompt_summary_client_1.py +++ b/docs/griptape-tools/official-tools/src/prompt_summary_client_1.py @@ -1,7 +1,7 @@ from griptape.structures import Agent -from griptape.tools import PromptSummaryTool, WebScraper +from griptape.tools import PromptSummaryTool, WebScraperTool -agent = Agent(tools=[WebScraper(off_prompt=True), PromptSummaryTool()]) +agent = Agent(tools=[WebScraperTool(off_prompt=True), PromptSummaryTool()]) agent.run( "How can I build Neovim from source for MacOS according to this https://github.com/neovim/neovim/blob/master/BUILD.md" diff --git a/docs/griptape-tools/official-tools/src/query_client_1.py b/docs/griptape-tools/official-tools/src/query_client_1.py index a6df7940d..0c612eee9 100644 --- a/docs/griptape-tools/official-tools/src/query_client_1.py +++ b/docs/griptape-tools/official-tools/src/query_client_1.py @@ -1,6 +1,6 @@ from griptape.structures import Agent -from griptape.tools import QueryTool, WebScraper +from griptape.tools import QueryTool, WebScraperTool -agent = Agent(tools=[WebScraper(off_prompt=True), QueryTool()]) +agent = Agent(tools=[WebScraperTool(off_prompt=True), QueryTool()]) agent.run("Tell me about the architecture as described here: https://neovim.io/doc/user/vim_diff.html") 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/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 89% 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 adc79ad12..266398d5e 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 PromptSummaryTool, VectorStoreClient +from griptape.tools import PromptSummaryTool, VectorStoreTool vector_store_driver = LocalVectorStoreDriver( embedding_driver=OpenAiEmbeddingDriver(), @@ -13,7 +13,7 @@ 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"}, diff --git a/docs/griptape-tools/official-tools/src/web_scraper_1.py b/docs/griptape-tools/official-tools/src/web_scraper_1.py index 14995d519..0e6f55011 100644 --- a/docs/griptape-tools/official-tools/src/web_scraper_1.py +++ b/docs/griptape-tools/official-tools/src/web_scraper_1.py @@ -1,6 +1,6 @@ from griptape.structures import Agent -from griptape.tools import PromptSummaryTool, WebScraper +from griptape.tools import PromptSummaryTool, WebScraperTool -agent = Agent(tools=[WebScraper(off_prompt=True), PromptSummaryTool(off_prompt=False)]) +agent = Agent(tools=[WebScraperTool(off_prompt=True), PromptSummaryTool(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..0e6f55011 --- /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 PromptSummaryTool, WebScraperTool + +agent = Agent(tools=[WebScraperTool(off_prompt=True), PromptSummaryTool(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/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 95% rename from docs/griptape-tools/official-tools/web-scraper.md rename to docs/griptape-tools/official-tools/web-scraper-tool.md index a4ceebfc5..8bbea1465 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" ``` ``` [08/12/24 15:32:08] INFO ToolkitTask b14a4305365f4b17a4dcf235f84397e2 @@ -12,7 +12,7 @@ This tool enables LLMs to scrape web pages for full text, summaries, authors, ti Actions: [ { "tag": "call_ExEzJDZuBfnsa9pZMSr6mtsS", - "name": "WebScraper", + "name": "WebScraperTool", "path": "get_content", "input": { "values": { @@ -22,7 +22,7 @@ This tool enables LLMs to scrape web pages for full text, summaries, authors, ti } ] INFO Subtask bf396977ea634eb28f55388d3f828f5d - Response: Output of "WebScraper.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace + Response: Output of "WebScraperTool.get_content" was stored in memory with memory_name "TaskMemory" and artifact_namespace "a55c85bf1aa944d5b69bbe8d61382179" [08/12/24 15:32:11] INFO Subtask 31852039bd274b71bf46feaf22b68112 Actions: [ 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 014f957fe..ce59088f3 100644 --- a/griptape/tools/__init__.py +++ b/griptape/tools/__init__.py @@ -1,70 +1,70 @@ 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 .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 ImageQueryTool -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 .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 from .extraction.tool import ExtractionTool from .prompt_summary.tool import PromptSummaryTool from .query.tool import QueryTool __all__ = [ "BaseTool", - "BaseImageGenerationClient", - "BaseAwsClient", - "AwsIamClient", - "AwsS3Client", - "BaseGoogleClient", - "GoogleGmailClient", - "GoogleDocsClient", - "GoogleCalendarClient", - "GoogleDriveClient", - "Calculator", - "WebSearch", - "WebScraper", - "SqlClient", - "EmailClient", - "RestApiClient", - "FileManager", - "VectorStoreClient", - "DateTime", - "Computer", - "OpenWeatherClient", - "PromptImageGenerationClient", - "VariationImageGenerationClient", - "InpaintingImageGenerationClient", - "OutpaintingImageGenerationClient", - "GriptapeCloudKnowledgeBaseClient", - "StructureRunClient", + "BaseImageGenerationTool", + "BaseAwsTool", + "AwsIamTool", + "AwsS3Tool", + "BaseGoogleTool", + "GoogleGmailTool", + "GoogleDocsTool", + "GoogleCalendarTool", + "GoogleDriveTool", + "CalculatorTool", + "WebSearchTool", + "WebScraperTool", + "SqlTool", + "EmailTool", + "RestApiTool", + "FileManagerTool", + "VectorStoreTool", + "DateTimeTool", + "ComputerTool", + "OpenWeatherTool", + "PromptImageGenerationTool", + "VariationImageGenerationTool", + "InpaintingImageGenerationTool", + "OutpaintingImageGenerationTool", + "GriptapeCloudKnowledgeBaseTool", + "StructureRunTool", "ImageQueryTool", - "RagClient", - "TextToSpeechClient", - "AudioTranscriptionClient", + "RagTool", + "TextToSpeechTool", + "AudioTranscriptionTool", "ExtractionTool", "PromptSummaryTool", "QueryTool", 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 100% rename from griptape/tools/image_query_client/tool.py rename to griptape/tools/image_query/tool.py 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/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 dd41eadc4..7a7b2e25d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -129,33 +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" - - 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" - - ImageQueryTool: "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" - ExtractionTool: "griptape-tools/official-tools/extraction-client.md" - QueryTool: "griptape-tools/official-tools/query-client.md" - PromptSummaryClient: "griptape-tools/official-tools/prompt-summary-client.md" 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 20db7b27a..e3b6d5399 100644 --- a/tests/integration/tasks/test_toolkit_task.py +++ b/tests/integration/tasks/test_toolkit_task.py @@ -1,5 +1,6 @@ import pytest +from griptape.tools import WebSearchTool from tests.utils.structure_tester import StructureTester @@ -14,17 +15,17 @@ def structure_tester(self, request): from griptape.drivers import GoogleWebSearchDriver from griptape.structures import Agent - from griptape.tools import PromptSummaryTool, WebScraper, WebSearch + from griptape.tools import PromptSummaryTool, WebScraperTool 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), + WebScraperTool(off_prompt=True), PromptSummaryTool(off_prompt=False), ], conversation_memory=None, 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_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)