Skip to content

Commit 87222ec

Browse files
authored
Nolan/collections summary (#1685)
* Add document summary to extraction process * Collection summarization and inclusion in community generation * Add test, fix mypy * Clean up * Fix test with new required body, remove print statements and add check
1 parent d84aa43 commit 87222ec

37 files changed

+206
-1062
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ repos:
1717
types: [python]
1818
pass_filenames: false
1919

20+
- repo: local
21+
hooks:
22+
- id: check-print-statements
23+
name: Check for print statements
24+
entry: bash -c 'echo "Checking for print statements..." && find . -name "*.py" ! -path "./py/cli/*" ! -path "./py/core/examples/*" ! -path "./py/migrations/*" ! -path "./py/tests/*" | xargs grep -n "print(" || exit 0 && echo "Found print statements!" && exit 1'
25+
language: system
26+
types: [python]
27+
pass_filenames: false
28+
2029
- repo: local
2130
hooks:
2231
- id: isort

js/sdk/__tests__/CollectionsIntegrationSuperUser.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,26 @@ describe("r2rClient V3 Collections Integration Tests", () => {
3535
test("Retrieve collection", async () => {
3636
const response = await client.collections.retrieve({ id: collectionId });
3737
expect(response.results).toBeDefined();
38+
expect(response.results.id).toBe(collectionId);
39+
expect(response.results.name).toBe("Test Collection");
40+
expect(response.results.description).toBeNull();
3841
});
3942

4043
test("Update collection", async () => {
4144
const response = await client.collections.update({
4245
id: collectionId,
4346
name: "Updated Test Collection",
47+
generateDescription: true,
4448
});
4549
expect(response.results).toBeDefined();
50+
}, 10000);
51+
52+
test("Retrieve updated collection", async () => {
53+
const response = await client.collections.retrieve({ id: collectionId });
54+
expect(response.results).toBeDefined();
55+
expect(response.results.id).toBe(collectionId);
56+
expect(response.results.name).toBe("Updated Test Collection");
57+
expect(response.results.description).toBeDefined();
4658
});
4759

4860
test("Ingest document and assign to collection", async () => {

js/sdk/__tests__/DocumentsAndCollectionsIntegrationUser.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe("r2rClient V3 System Integration Tests User", () => {
114114

115115
expect(response.results.document_id).toBeDefined();
116116
user1DocumentId = response.results.document_id;
117-
}, 10000);
117+
}, 15000);
118118

119119
test("Create document as user 2 with file path", async () => {
120120
const response = await user2Client.documents.create({
@@ -126,7 +126,7 @@ describe("r2rClient V3 System Integration Tests User", () => {
126126

127127
expect(response.results.document_id).toBeDefined();
128128
user2DocumentId = response.results.document_id;
129-
}, 10000);
129+
}, 15000);
130130

131131
test("Retrieve document as user 1", async () => {
132132
const response = await user1Client.documents.retrieve({

js/sdk/__tests__/GraphsIntegrationSuperUser.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ describe("r2rClient V3 Graphs Integration Tests", () => {
228228
predicate: "falls in love with",
229229
object: "Dunia",
230230
objectId: entity2Id,
231+
description: "Razumikhn and Dunia are central to the story",
231232
});
232233

233234
relationshipId = response.results.id;
@@ -236,6 +237,7 @@ describe("r2rClient V3 Graphs Integration Tests", () => {
236237
expect(response.results.subject).toBe("Razumikhin");
237238
expect(response.results.object).toBe("Dunia");
238239
expect(response.results.predicate).toBe("falls in love with");
240+
expect(response.results.description).toBe("Razumikhn and Dunia are central to the story");
239241
});
240242

241243
test("Retrieve the relationship", async () => {

0 commit comments

Comments
 (0)