From a6880bdbea1bc7e07be28b3896b55e08326d5a32 Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Wed, 17 Jul 2024 14:14:16 -0700 Subject: [PATCH 1/5] Fix cohere link --- docs/griptape-framework/drivers/prompt-drivers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/griptape-framework/drivers/prompt-drivers.md b/docs/griptape-framework/drivers/prompt-drivers.md index bc6142d3d..2ea87dc50 100644 --- a/docs/griptape-framework/drivers/prompt-drivers.md +++ b/docs/griptape-framework/drivers/prompt-drivers.md @@ -160,7 +160,7 @@ agent.run("Artificial intelligence is a technology with great promise.") ### Cohere -The [CoherePromptDriver](../../reference/griptape/drivers/prompt/cohere_prompt_driver.md) connects to the Cohere [Generate](https://docs.cohere.ai/reference/generate) API. +The [CoherePromptDriver](../../reference/griptape/drivers/prompt/cohere_prompt_driver.md) connects to the Cohere [Chat](https://docs.cohere.com/docs/chat-api) API. !!! info This driver requires the `drivers-prompt-cohere` [extra](../index.md#extras). From 36c61b7e0786215fda051090daa1cc5e07aff74a Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Wed, 17 Jul 2024 14:36:36 -0700 Subject: [PATCH 2/5] Remove task memory warning --- docs/griptape-framework/drivers/prompt-drivers.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/griptape-framework/drivers/prompt-drivers.md b/docs/griptape-framework/drivers/prompt-drivers.md index 2ea87dc50..cd9d67021 100644 --- a/docs/griptape-framework/drivers/prompt-drivers.md +++ b/docs/griptape-framework/drivers/prompt-drivers.md @@ -56,9 +56,6 @@ print(result.value) Griptape offers the following Prompt Drivers for interacting with LLMs. -!!! warning - When overriding a default Prompt Driver, take care to ensure you've updated the Structure's configured Embedding Driver as well. If Task Memory isn't needed, you can avoid compatibility issues by setting `task_memory=None` to disable Task Memory in your Structure. - ### OpenAI Chat !!! info From 1f0fc54d6cd3dd886517847d303b7d3c2dea46d4 Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Wed, 17 Jul 2024 14:36:47 -0700 Subject: [PATCH 3/5] Restructure tool calling bits --- .../drivers/prompt-drivers.md | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/docs/griptape-framework/drivers/prompt-drivers.md b/docs/griptape-framework/drivers/prompt-drivers.md index cd9d67021..a438e985e 100644 --- a/docs/griptape-framework/drivers/prompt-drivers.md +++ b/docs/griptape-framework/drivers/prompt-drivers.md @@ -58,10 +58,8 @@ Griptape offers the following Prompt Drivers for interacting with LLMs. ### OpenAI Chat -!!! info - This driver uses [OpenAi function calling](https://platform.openai.com/docs/guides/function-calling) when using [Tools](../tools/index.md). You can change this to use Griptape's own tool calling implementation by setting `use_native_tools` to `False`. - The [OpenAiChatPromptDriver](../../reference/griptape/drivers/prompt/openai_chat_prompt_driver.md) connects to the [OpenAI Chat](https://platform.openai.com/docs/guides/chat) API. +This driver uses [OpenAi function calling](https://platform.openai.com/docs/guides/function-calling) when using [Tools](../tools/index.md). ```python import os @@ -123,10 +121,8 @@ agent.run("How do I init and update a git submodule?") ### Azure OpenAI Chat -!!! info - This driver uses [Azure OpenAi function calling](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/function-calling) when using [Tools](../tools/index.md). You can change this to use Griptape's own tool calling implementation by setting `use_native_tools` to `False`. - The [AzureOpenAiChatPromptDriver](../../reference/griptape/drivers/prompt/azure_openai_chat_prompt_driver.md) connects to Azure OpenAI [Chat Completion](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference) APIs. +This driver uses [Azure OpenAi function calling](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/function-calling) when using [Tools](../tools/index.md). ```python import os @@ -158,13 +154,11 @@ agent.run("Artificial intelligence is a technology with great promise.") ### Cohere The [CoherePromptDriver](../../reference/griptape/drivers/prompt/cohere_prompt_driver.md) connects to the Cohere [Chat](https://docs.cohere.com/docs/chat-api) API. +This driver uses [Cohere tool use](https://docs.cohere.com/docs/tools) when using [Tools](../tools/index.md). !!! info This driver requires the `drivers-prompt-cohere` [extra](../index.md#extras). -!!! info - This driver uses [Cohere tool use](https://docs.cohere.com/docs/tools) when using [Tools](../tools/index.md). You can change this to use Griptape's own tool calling implementation by setting `use_native_tools` to `False`. - ```python import os from griptape.structures import Agent @@ -188,10 +182,8 @@ agent.run('What is the sentiment of this review? Review: "I really enjoyed this !!! info This driver requires the `drivers-prompt-anthropic` [extra](../index.md#extras). -!!! info - This driver uses [Anthropic tool use](https://docs.anthropic.com/en/docs/build-with-claude/tool-use) when using [Tools](../tools/index.md). You can change this to use Griptape's own tool calling implementation by setting `use_native_tools` to `False`. - The [AnthropicPromptDriver](../../reference/griptape/drivers/prompt/anthropic_prompt_driver.md) connects to the Anthropic [Messages](https://docs.anthropic.com/claude/reference/messages_post) API. +This driver uses [Anthropic tool use](https://docs.anthropic.com/en/docs/build-with-claude/tool-use) when using [Tools](../tools/index.md). ```python import os @@ -216,10 +208,8 @@ agent.run('Where is the best place to see cherry blossums in Japan?') !!! info This driver requires the `drivers-prompt-google` [extra](../index.md#extras). -!!! info - This driver uses [Gemini function calling](https://ai.google.dev/gemini-api/docs/function-calling) when using [Tools](../tools/index.md). You can change this to use Griptape's own tool calling implementation by setting `use_native_tools` to `False`. - The [GooglePromptDriver](../../reference/griptape/drivers/prompt/google_prompt_driver.md) connects to the [Google Generative AI](https://ai.google.dev/tutorials/python_quickstart#generate_text_from_text_inputs) API. +This driver uses [Gemini function calling](https://ai.google.dev/gemini-api/docs/function-calling) when using [Tools](../tools/index.md). ```python import os @@ -244,10 +234,8 @@ agent.run('Briefly explain how a computer works to a young child.') !!! info This driver requires the `drivers-prompt-amazon-bedrock` [extra](../index.md#extras). -!!! info - This drivers uses [Bedrock tool use](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) when using [Tools](../tools/index.md). You can change this to use Griptape's own tool calling implementation by setting `use_native_tools` to `False`. - The [AmazonBedrockPromptDriver](../../reference/griptape/drivers/prompt/amazon_bedrock_prompt_driver.md) uses [Amazon Bedrock](https://aws.amazon.com/bedrock/)'s [Converse API](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html). +This driver uses [Bedrock tool use](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) when using [Tools](../tools/index.md). All models supported by the Converse API are available for use with this driver. @@ -313,7 +301,6 @@ agent.run("What color is the sky at different times of the day?") The [HuggingFaceHubPromptDriver](../../reference/griptape/drivers/prompt/huggingface_hub_prompt_driver.md) connects to the [Hugging Face Hub API](https://huggingface.co/docs/hub/api). - !!! warning Not all models featured on the Hugging Face Hub are supported by this driver. Models that are not supported by [Hugging Face serverless inference](https://huggingface.co/docs/api-inference/en/index) will not work with this driver. From 4b4dd74940d7dd13923a51fb4636df185f347af1 Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Wed, 17 Jul 2024 14:42:16 -0700 Subject: [PATCH 4/5] Remove comma --- docs/griptape-framework/misc/events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/griptape-framework/misc/events.md b/docs/griptape-framework/misc/events.md index 851b5f382..dff54ec4e 100644 --- a/docs/griptape-framework/misc/events.md +++ b/docs/griptape-framework/misc/events.md @@ -171,7 +171,7 @@ pipeline.config.prompt_driver.stream = True pipeline.add_tasks(ToolkitTask("Based on https://griptape.ai, tell me what griptape is.", tools=[WebScraper(off_prompt=True), TaskMemoryClient(off_prompt=False)])) for artifact in Stream(pipeline).run(): - print(artifact.value, end="", flush=True), + print(artifact.value, end="", flush=True) ``` From e4281aed90737d5102ad8432734a55b4b355b51f Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Thu, 18 Jul 2024 11:18:06 -0700 Subject: [PATCH 5/5] Add explanation of use_native_tools --- docs/griptape-framework/tools/index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/griptape-framework/tools/index.md b/docs/griptape-framework/tools/index.md index 05fc94501..fecfd6cd7 100644 --- a/docs/griptape-framework/tools/index.md +++ b/docs/griptape-framework/tools/index.md @@ -1,7 +1,10 @@ ## Overview One of the most powerful features of Griptape is the ability to use tools that can interact with the outside world. -Many of our [Prompt Drivers](../drivers/prompt-drivers.md) leverage the native function calling built into the LLMs. For LLMs that don't support this, Griptape provides its own implementation using the [ReAct](https://arxiv.org/abs/2210.03629) technique. +Many of our [Prompt Drivers](../drivers/prompt-drivers.md) leverage the native function calling built into the LLMs. +For LLMs that don't support this, Griptape provides its own implementation using the [ReAct](https://arxiv.org/abs/2210.03629) technique. + +You can switch between the two strategies by setting `use_native_tools` to `True` (LLM-native tool calling) or `False` (Griptape tool calling) on your [Prompt Driver][../drivers/prompt-drivers.md]. ## Tools Here is an example of a Pipeline using Tools: