-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VectorQueryEngine issue with loading artifacts from query #778
Closed
1 task done
Labels
bug
Something isn't working
Comments
Hi @qwe321389yfs8t7huqd89q, thanks for surfacing this issue! I've reproduced this using the following steps:
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:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Using this example and Redis I'm getting error:
Response: error querying vector store: string indices must be integers, not 'str'
I don't have any other Vector DB so not sure if same thing happens with other drivers, looking at source code it should behave same as for Redis.
Tracked it down to this line:
griptape/griptape/engines/query/vector_query_engine.py
Line 36 in a899f5a
It assumes that meta is dict, but in fact query returns string from DB.
Possible solutions
VectorQueryEngine
(only a quick fix to make example code work with Redis):query
returnsmeta
as dict.VectorQueryEngine
to useload_entry
method from Vector Driver before loading artifact.I think best would be second option, as it won't affect
LocalVectorStoreDriver
.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: