Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/test/java/com/embabel/impromptu/TestDataHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void clearTestData() {
*/
public long countComposers() {
return persistenceManager.getOne(
QuerySpecification.withStatement("MATCH (c:Composer) RETURN count(c)")
QuerySpecification.withStatement("MATCH (c:Composer) WHERE c.primarySource = 'test' RETURN count(c)")
.transform(Long.class)
);
}
Expand All @@ -245,7 +245,7 @@ public long countComposers() {
*/
public long countWorks() {
return persistenceManager.getOne(
QuerySpecification.withStatement("MATCH (w:Work) RETURN count(w)")
QuerySpecification.withStatement("MATCH (w:Work) WHERE w.primarySource = 'test' RETURN count(w)")
.transform(Long.class)
);
}
Expand Down
21 changes: 0 additions & 21 deletions src/test/java/com/embabel/impromptu/TestLlmConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,26 +127,11 @@ public EmbeddingResponse call(EmbeddingRequest request) {
return new EmbeddingResponse(List.of());
}

@Override
public float[] embed(String text) {
return new float[1536];
}

@Override
public float[] embed(Document document) {
return new float[1536];
}

@Override
public List<float[]> embed(List<String> texts) {
return texts.stream().map(t -> new float[1536]).toList();
}

@Override
public EmbeddingResponse embedForResponse(List<String> texts) {
return new EmbeddingResponse(List.of());
}

@Override
public int dimensions() {
return 1536;
Expand All @@ -157,7 +142,6 @@ public int dimensions() {
* A simple fake EmbeddingService for tests.
*/
static class FakeEmbeddingService implements EmbeddingService {
private final FakeEmbeddingModel model = new FakeEmbeddingModel();

@Override
public String getName() {
Expand Down Expand Up @@ -186,11 +170,6 @@ public List<float[]> embed(List<String> texts) {
public int getDimensions() {
return 1536;
}

@Override
public Object getModel() {
return model;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class YouTubePerformancePersistenceIntegrationTest {
private NamedEntityDataRepository namedEntityDataRepository;

private static final String TEST_VIDEO_ID = "dQw4w9WgXcQ";
private static final String TEST_PERFORMANCE_ID = TEST_VIDEO_ID;
private static final String TEST_PERFORMANCE_ID = "perf-" + TEST_VIDEO_ID;
private static final String TEST_WORK_ID = "work-brahms-symphony4";

@BeforeEach
Expand Down Expand Up @@ -123,7 +123,7 @@ private void createTestData() {
perf.performer = $performer,
perf.ensemble = $ensemble,
perf.conductor = $conductor,
perf.primarySource = 'youtube-test'
perf.primarySource = $primarySource
""")
.bind(Map.of(
"id", TEST_PERFORMANCE_ID,
Expand All @@ -132,7 +132,8 @@ private void createTestData() {
"videoId", TEST_VIDEO_ID,
"performer", "",
"ensemble", "Berlin Philharmonic",
"conductor", "Herbert von Karajan"
"conductor", "Herbert von Karajan",
"primarySource", "youtube-test"
))
);

Expand Down