Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ private void runEmbeddingTest(TestNamespace ns, SearchRepository searchRepo) thr
updatedFingerprint,
"Fingerprint should change after description update");

String textToEmbed = getFieldFromDoc(searchClient, entityIndexName, tableId, "textToEmbed");
String textToLLMContext =
getFieldFromDoc(searchClient, entityIndexName, tableId, "textToLLMContext");
assertTrue(
textToEmbed.contains("Revenue metrics"),
"textToEmbed should reflect the patched description");
textToLLMContext.contains("Revenue metrics"),
"textToLLMContext should reflect the patched description");

String embeddingJson = getFieldFromDoc(searchClient, entityIndexName, tableId, "embedding");
assertNotNull(embeddingJson, "Embedding vector should exist after PATCH");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void testEntityEmbeddingCreationViaPartialUpdate() throws Exception {

Map<String, Object> doc = getDocumentById(testTable.getId().toString());
assertNotNull(doc, "Entity document should exist");
assertNotNull(doc.get("textToEmbed"), "Document should have text_to_embed");
assertNotNull(doc.get("textToLLMContext"), "Document should have textToLLMContext");
assertNotNull(doc.get("embedding"), "Document should have embedding");
assertNotNull(doc.get("fingerprint"), "Document should have fingerprint");
assertEquals(
Expand Down Expand Up @@ -323,7 +323,7 @@ void testGenerateEmbeddingFields() {

assertNotNull(fields);
assertNotNull(fields.get("embedding"));
assertNotNull(fields.get("textToEmbed"));
assertNotNull(fields.get("textToLLMContext"));
assertNotNull(fields.get("fingerprint"));
assertEquals(testTable.getId().toString(), fields.get("parentId"));
assertEquals(0, fields.get("chunkIndex"));
Expand All @@ -347,7 +347,7 @@ void testPatchTableDescriptionUpdatesEmbeddingForSemanticSearch() throws Excepti

Map<String, Object> initialDoc = getDocumentById(testTable.getId().toString());
String initialFingerprint = (String) initialDoc.get("fingerprint");
String initialTextToEmbed = (String) initialDoc.get("textToEmbed");
String initialTextToEmbed = (String) initialDoc.get("textToLLMContext");

String patchedDescription = "Revenue metrics for quarterly financial reporting analysis";
testTable.setDescription(patchedDescription);
Expand All @@ -358,15 +358,16 @@ void testPatchTableDescriptionUpdatesEmbeddingForSemanticSearch() throws Excepti

Map<String, Object> updatedDoc = getDocumentById(testTable.getId().toString());
String updatedFingerprint = (String) updatedDoc.get("fingerprint");
String updatedTextToEmbed = (String) updatedDoc.get("textToEmbed");
String updatedTextToEmbed = (String) updatedDoc.get("textToLLMContext");

assertFalse(
initialFingerprint.equals(updatedFingerprint), "Fingerprint should change after PATCH");
assertFalse(
initialTextToEmbed.equals(updatedTextToEmbed), "textToEmbed should change after PATCH");
initialTextToEmbed.equals(updatedTextToEmbed),
"textToLLMContext should change after PATCH");
assertTrue(
updatedTextToEmbed.contains("Revenue metrics"),
"Updated textToEmbed should reflect patched description");
"Updated textToLLMContext should reflect patched description");

List<Map<String, Object>> results =
executeKnnSearch("quarterly financial revenue reporting", 10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ void testHitFieldsCleaned() throws Exception {
hit.put("columns", List.of(Map.of("name", "id", "dataType", "INT")));
hit.put("embedding", new float[] {0.1f, 0.2f});
hit.put("fingerprint", "abc123");
hit.put("textToEmbed", "name: users; entityType: table | description: A short description");
hit.put(
"textToLLMContext", "name: users; entityType: table | description: A short description");

VectorSearchResponse response = new VectorSearchResponse(10L, List.of(hit));

Expand Down Expand Up @@ -233,7 +234,7 @@ void testHitFieldsCleaned() throws Exception {
assertTrue(!cleaned.containsKey("_score"));
assertTrue(!cleaned.containsKey("embedding"));
assertTrue(!cleaned.containsKey("fingerprint"));
assertTrue(!cleaned.containsKey("textToEmbed"));
assertTrue(!cleaned.containsKey("textToLLMContext"));
}
}

Expand Down
Loading
Loading