Open forkhroy opened 1 month ago
We could internally create a DB directory alias to load from any path but I believe the path would have to be on the server
We extend from DimensionAwareEmbeddingModel so we just need to define embedAll. In the test there is a singular version which then calls embedAll.
Response<Embedding> resp = embedder.embed("hello world");
assertThat(resp.content().dimension()).isGreaterThan(1);
TextSegment segment = TextSegment.from("hello world");
Response<Embedding> resp2 = embedder.embed(segment);
assertThat(resp2.content().dimension()).isGreaterThan(1);
List<TextSegment> textSegments = new ArrayList<>();
textSegments.add(TextSegment.from("hello world"));
textSegments.add(TextSegment.from("goodbye world"));
textSegments.add(TextSegment.from("1,2,3"));
Response<List<Embedding>> resp3 = embedder.embedAll(textSegments);
This is their naming convention to end in EmbeddingModel like LanguageModel