Skip to content

Commit

Permalink
Merge branch 'dev' into refactor/task-memory-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Aug 13, 2024
2 parents 336c46b + aea51bb commit 334843a
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 25 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Global config, `griptape.config.config`, for setting global configuration defaults.
- Unique name generation for all `RagEngine` modules.
- `ExtractionTool` Tool for having the LLM extract structured data from text.
- `PromptSummaryClient` Tool for having the LLM summarize text.
- `PromptSummaryTool` Tool for having the LLM summarize text.
- `QueryTool` Tool for having the LLM query text.

### Changed
Expand All @@ -41,11 +41,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **BREAKING**: Changed `JsonExtractionEngine.template_schema` from a `run` argument to a class attribute.
- **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**: Removed `TaskMemoryClient`, use `RagClient`, `ExtractionTool`, or `PromptSummaryTool` 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.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ And here is the output:
Actions: [
{
"tag": "call_o9F1taIxHty0mDlWLcAjTAAu",
"name": "PromptSummaryClient",
"name": "PromptSummaryTool",
"path": "summarize",
"input": {
"values": {
Expand All @@ -139,7 +139,7 @@ And here is the output:
}
]
[08/12/24 14:48:21] INFO Subtask dca04901436d49d2ade86cd6b4e1038a
Response: Output of "PromptSummaryClient.summarize" was stored in memory with memory_name "TaskMemory" and artifact_namespace
Response: Output of "PromptSummaryTool.summarize" was stored in memory with memory_name "TaskMemory" and artifact_namespace
"73765e32b8404e32927822250dc2ae8b"
[08/12/24 14:48:22] INFO Subtask c233853450fb4fd6a3e9c04c52b33bf6
Actions: [
Expand Down
2 changes: 1 addition & 1 deletion docs/griptape-framework/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Agents are great for getting started, but they are intentionally limited to a si
Actions: [
{
"tag": "call_ElTYTPeocOU62I0VjzRqmfoF",
"name": "PromptSummaryClient",
"name": "PromptSummaryTool",
"path": "summarize",
"input": {
"values": {
Expand Down
12 changes: 6 additions & 6 deletions docs/griptape-framework/structures/task-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ Let's explore what happens when `off_prompt` is set to `True`:
```

When we set `off_prompt` to `True`, the Agent does not function as expected, even generating an error. This is because the Calculator output is being stored in Task Memory but the Agent has no way to access it.
To fix this, we need a [Tool that can read from Task Memory](#tools-that-can-read-from-task-memory) such as the `PromptSummaryClient`.
To fix this, we need a [Tool that can read from Task Memory](#tools-that-can-read-from-task-memory) such as the `PromptSummaryTool`.
This is an example of [not providing a Task Memory compatible Tool](#not-providing-a-task-memory-compatible-tool).

## Prompt Summary Client

The [PromptSummaryClient](../../griptape-tools/official-tools/prompt-summary-client.md) is a Tool that allows an Agent to summarize the Artifacts in Task Memory. It has the following methods:
The [PromptSummaryTool](../../griptape-tools/official-tools/prompt-summary-client.md) is a Tool that allows an Agent to summarize the Artifacts in Task Memory. It has the following methods:

Let's add `PromptSummaryClient` to the Agent and run the same task.
Note that on the `PromptSummaryClient` we've set `off_prompt` to `False` so that the results of the query can be returned directly to the LLM.
Let's add `PromptSummaryTool` to the Agent and run the same task.
Note that on the `PromptSummaryTool` we've set `off_prompt` to `False` so that the results of the query can be returned directly to the LLM.
If we had kept it as `True`, the results would have been stored back Task Memory which would've put us back to square one. See [Task Memory Looping](#task-memory-looping) for more information on this scenario.

```python
Expand Down Expand Up @@ -107,7 +107,7 @@ If we had kept it as `True`, the results would have been stored back Task Memory
Actions: [
{
"tag": "call_qqpsWEvAUGIcPLrwAHGuH6o3",
"name": "PromptSummaryClient",
"name": "PromptSummaryTool",
"path": "summarize",
"input": {
"values": {
Expand Down Expand Up @@ -273,7 +273,7 @@ As seen in the previous example, certain Tools are designed to read directly fro

Today, these include:

- [PromptSummaryClient](../../griptape-tools/official-tools/prompt-summary-client.md)
- [PromptSummaryTool](../../griptape-tools/official-tools/prompt-summary-client.md)
- [ExtractionTool](../../griptape-tools/official-tools/extraction-client.md)
- [RagClient](../../griptape-tools/official-tools/rag-client.md)
- [FileManagerTool](../../griptape-tools/official-tools/file-manager.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/griptape-framework/structures/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ This Task takes in one or more Tools which the LLM will decide to use through Ch
Actions: [
{
"tag": "call_aT7DX0YSQPmOcnumWXrGoMNt",
"name": "PromptSummaryClient",
"name": "PromptSummaryTool",
"path": "summarize",
"input": {
"values": {
Expand All @@ -134,7 +134,7 @@ This Task takes in one or more Tools which the LLM will decide to use through Ch
}
]
[08/12/24 15:16:37] INFO Subtask ee5f11666ded4dc39b94e4c59d18fbc7
Response: Output of "PromptSummaryClient.summarize" was stored in memory with memory_name "TaskMemory" and artifact_namespace
Response: Output of "PromptSummaryTool.summarize" was stored in memory with memory_name "TaskMemory" and artifact_namespace
"669d29a704444176be93d09d014298df"
[08/12/24 15:16:38] INFO Subtask d9b2dd9f96d841f49f5d460e33905183
Actions: [
Expand Down
2 changes: 1 addition & 1 deletion docs/griptape-framework/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Here is an example of a Pipeline using Tools:
Actions: [
{
"tag": "call_0VOTEvinRer7rG4oEirBYcow",
"name": "PromptSummaryClient",
"name": "PromptSummaryTool",
"path": "summarize",
"input": {
"values": {
Expand Down
4 changes: 2 additions & 2 deletions docs/griptape-tools/official-tools/prompt-summary-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ The [RagClient](../../reference/griptape/tools/rag_client/tool.md) enables LLMs
Here is an example of how it can be used with a local vector store driver:

```python
--8<-- "docs/griptape-tools/official-tools/src/prompt_summary_client_1.py"
--8<-- "docs/griptape-tools/official-tools/src/prompt_summary_tool_1.py"
```
```
[08/12/24 15:54:46] INFO ToolkitTask 8be73eb542c44418ba880399044c017a
Expand All @@ -28,7 +28,7 @@ Here is an example of how it can be used with a local vector store driver:
Actions: [
{
"tag": "call_DK3a4MYoElJbaCrUJekBReIc",
"name": "PromptSummaryClient",
"name": "PromptSummaryTool",
"path": "summarize",
"input": {
"values": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
image_query_driver=driver,
)

# Create an Image Query Client configured to use the engine.
# Create an Image Query Tool configured to use the engine.
tool = ImageQueryTool(
image_query_engine=engine,
)
Expand Down
2 changes: 1 addition & 1 deletion docs/griptape-tools/official-tools/web-scraper-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This tool enables LLMs to scrape web pages for full text, summaries, authors, ti
Actions: [
{
"tag": "call_6Dovx2GKE2GLjaYIuwXvBxVn",
"name": "PromptSummaryClient",
"name": "PromptSummaryTool",
"path": "summarize",
"input": {
"values": {
Expand Down
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ nav:
- 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"
- Extraction: "griptape-tools/official-tools/extraction-client.md"
- Query: "griptape-tools/official-tools/query-client.md"
- Prompt Summary: "griptape-tools/official-tools/prompt-summary-client.md"
- Custom Tools:
- Building Custom Tools: "griptape-tools/custom-tools/index.md"
- Recipes:
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/tasks/test_toolkit_task.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest

from griptape.tools import WebSearchTool
from tests.utils.structure_tester import StructureTester


Expand All @@ -15,7 +14,7 @@ def structure_tester(self, request):

from griptape.drivers import GoogleWebSearchDriver
from griptape.structures import Agent
from griptape.tools import PromptSummaryTool, WebScraperTool
from griptape.tools import PromptSummaryTool, WebScraperTool, WebSearchTool

return StructureTester(
Agent(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/tools/test_prompt_summary_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from tests.utils import defaults


class TestPromptSummaryClient:
class TestPromptSummaryTool:
@pytest.fixture()
def tool(self):
return PromptSummaryTool(
Expand Down

0 comments on commit 334843a

Please sign in to comment.