Comments (1)
Hi @qwe321389yfs8t7huqd89q, thanks for surfacing this issue!
I've reproduced this using the following steps:
- Started a local redis server with the redis search module:
docker run -p 6379:6379 redislabs/redisearch:latest
- Created an index.
redis-cli FT.CREATE idx:griptape ON hash PREFIX 1 "griptape:" SCHEMA tag TAG vector VECTOR FLAT 6 TYPE FLOAT32 DIM 1536 DISTANCE_METRIC COSINE
- Ran the example, replacing
LocalVectorStoreDriver
withRedisVectorStoreDriver
.
Full Program:
from dotenv import load_dotenv
from griptape.structures import Agent
from griptape.tools import VectorStoreClient, TaskMemoryClient
from griptape.loaders import WebLoader
from griptape.engines import VectorQueryEngine
from griptape.drivers import RedisVectorStoreDriver, OpenAiEmbeddingDriver, OpenAiChatPromptDriver
load_dotenv()
engine = VectorQueryEngine(
prompt_driver=OpenAiChatPromptDriver(model="gpt-3.5-turbo"),
vector_store_driver=RedisVectorStoreDriver(
host="localhost",
port=6379,
password="",
index="idx:griptape",
embedding_driver=OpenAiEmbeddingDriver(),
),
)
engine.upsert_text_artifacts(
WebLoader().load("https://www.griptape.ai"),
namespace="griptape"
)
vector_db = VectorStoreClient(
description="This DB has information about the Griptape Python framework",
query_engine=engine,
namespace="griptape"
)
agent = Agent(
tools=[vector_db, TaskMemoryClient(off_prompt=False)]
)
agent.run(
"what is Griptape?"
)
Full Output:
[05/15/24 09:14:48] INFO ToolkitTask 7fded25e6c244321a9233a3badbb4fa6
Input: what is Griptape?
[05/15/24 09:14:52] INFO Subtask 9c9d60f4761d432986781d48fe724a43
Thought: I need to search the vector database for information about the Griptape Python
framework.
Actions: [
{
"name": "VectorStoreClient",
"path": "search",
"input": {
"values": {
"query": "What is Griptape Python framework?"
}
},
"tag": "search_griptape"
}
]
[05/15/24 09:14:53] INFO Subtask 9c9d60f4761d432986781d48fe724a43
Response: error querying vector store: string indices must be integers, not 'str'
[05/15/24 09:14:58] INFO Subtask 71dac42b65464856831bdb342604789d
Thought: There seems to be an error with the way I structured the action. I need to correct
the input format and try again.
Actions: [
{
"name": "VectorStoreClient",
"path": "search",
"input": {
"values": {
"query": "What is Griptape Python framework?"
}
},
"tag": "search_griptape"
}
]
INFO Subtask 71dac42b65464856831bdb342604789d
Response: error querying vector store: string indices must be integers, not 'str'
[05/15/24 09:15:05] INFO Subtask 71d47cb90fe8491184186bb9dd47824a
Thought: The same error occurred again. It seems there might be an issue with the
VectorStoreClient action. I will try to use the TaskMemoryClient action to search the memory
content for information about Griptape.
Actions: [{"tag": "query_griptape", "name": "TaskMemoryClient", "path": "query", "input":
{"values": {"memory_name": "griptape_info", "artifact_namespace": "griptape", "query": "What
is Griptape Python framework?"}}}]
INFO Subtask 71d47cb90fe8491184186bb9dd47824a
Response: memory not found
[05/15/24 09:15:10] INFO Subtask b760ab6da0f1473685c8bca126477928
Thought: The memory does not contain information about Griptape. I will try to summarize the
memory content to see if there is any relevant information.
Actions: [{"tag": "summarize_memory", "name": "TaskMemoryClient", "path": "summarize",
"input": {"values": {"memory_name": "griptape_info", "artifact_namespace": "griptape"}}}]
INFO Subtask b760ab6da0f1473685c8bca126477928
Response: memory not found
[05/15/24 09:15:15] INFO ToolkitTask 7fded25e6c244321a9233a3badbb4fa6
Output: I'm sorry, but I am currently unable to provide information about Griptape.
from griptape.
Related Issues (20)
- Add Gemini Image Query Driver
- Add Google Gemini support
- BedrockLlamaPromptModelDriver does not apply input truncation, resulting in ValidationError HOT 4
- Add Support For Mistral on AWS Bedrock
- BedrockClaudePromptModelDriver results in ValidationError for Claude V3* models due to incorrect invoke struct HOT 1
- JsonExtractionEngine produces malformed JSON
- ignored_exception_types not working as intended
- vLLM endpoint support HOT 4
- CodeExecutionTask doesn't handle inputs correctly when in a Workflow HOT 2
- Calculating Max Output Tokens Is Inconsistent Across Prompt Drivers
- Driver secrets are serializable
- Azure OpenAI api version `2023-12-01-preview` deprecation HOT 2
- Bing Search Wrapper for WebSearch tool HOT 1
- Add model to emitted events.
- Use rich.print in Chat utility HOT 5
- Bump Pinecone from 2 to 3 HOT 1
- Add StructureRunDrivers to the documentation sidebar HOT 1
- Add `AzureOpenAiStructureConfig`
- Add DuckDuckGo Search tool HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from griptape.