Skip to content
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

Merged
merged 91 commits into from
Jul 12, 2024
Merged

Conversation

cjkindel
Copy link
Contributor

No description provided.

@cjkindel cjkindel self-assigned this Jun 21, 2024
@cjkindel cjkindel requested a review from a team June 21, 2024 18:11
@cjkindel
Copy link
Contributor Author

cjkindel commented Jul 8, 2024

@cjkindel is this ready for review? It's still marked as a draft.

Ready for general review but not final form until 28 is finalized

@cjkindel cjkindel marked this pull request as ready for review July 10, 2024 18:12
Copy link
Member

@collindutter collindutter left a 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.

Comment on lines 93 to 100
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
Copy link
Member

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?

Comment on lines 15 to 37
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],
},
]
}
Copy link
Member

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

Comment on lines 41 to 42
def mock_requests_post(*args, **kwargs):
return MockResponse(test_entries, 200)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mock how we do it here.

I assume you borrowed this style from here which should probably be updated at some point.

@@ -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:
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused?

collindutter
collindutter previously approved these changes Jul 11, 2024
Copy link
Member

@collindutter collindutter left a 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!

@cjkindel cjkindel merged commit 9fb4dd9 into dev Jul 12, 2024
11 of 12 checks passed
@cjkindel cjkindel deleted the cjkindel/gtc_vector_store_driver branch July 12, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants