-
Notifications
You must be signed in to change notification settings - Fork 175
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
GriptapeCloudVectorStoreDriver #885
Conversation
Ready for general review but not final form until 28 is finalized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good! Minor test things, also please update docs.
if count is not None: | ||
request["count"] = count | ||
if distance_metric is not None: | ||
request["distance_metric"] = distance_metric | ||
if filter is not None: | ||
request["filter"] = filter | ||
if include_vectors is not None: | ||
request["include_vectors"] = include_vectors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe refactor to use this syntax?
test_ids = [str(uuid.uuid4()), str(uuid.uuid4())] | ||
test_vecs = [[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]] | ||
test_namespaces = [str(uuid.uuid4()), str(uuid.uuid4())] | ||
test_metas = [{"key": "value1"}, {"key": "value2"}] | ||
test_scores = [0.7, 0.8] | ||
test_entries = { | ||
"entries": [ | ||
{ | ||
"id": test_ids[0], | ||
"vector": test_vecs[0], | ||
"namespace": test_namespaces[0], | ||
"meta": test_metas[0], | ||
"score": test_scores[0], | ||
}, | ||
{ | ||
"id": test_ids[1], | ||
"vector": test_vecs[1], | ||
"namespace": test_namespaces[1], | ||
"meta": test_metas[1], | ||
"score": test_scores[1], | ||
}, | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move into mock_requests_post
def mock_requests_post(*args, **kwargs): | ||
return MockResponse(test_entries, 200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -49,6 +49,30 @@ print("\n\n".join(values)) | |||
|
|||
``` | |||
|
|||
### Griptape Cloud Knowledge Base | |||
|
|||
The [GriptapeCloudKnowledgeBaseVectorStoreDriver](../../reference/griptape/drivers/vector/griptape_cloud_knowledge_base_vector_store_driver.md) can be used to query data from a Griptape Cloud Knowledge Base. Loading into Knowledge Bases is not support, only querying. Here is a complete example of how the driver can be used to query an existing Knowledge Base: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is not support
-> is not supported at this time
.
driver
-> Driver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want Driver capitalized, it isn't for rest of entries (can update all if we want)
|
||
@pytest.fixture | ||
def driver(self, mocker): | ||
from griptape.drivers import GriptapeCloudKnowledgeBaseVectorStoreDriver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to top level import
import uuid | ||
|
||
|
||
class MockResponse: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the find and replace!
No description provided.