-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Reviewed that documentation matches the code and fixed docs discrepancies * Refactored the `Embedding` object to be a record and include metadata and an ID that will be retrieved afterwards from the vector store * Implemented constructor that accepts explicit credentials in addition to supporting environment variables * The OpenAI embeddings generator now injects the original text, the model name and a timestamp in the embeddings metadata automatically
- Loading branch information
1 parent
d3920c7
commit fadd524
Showing
13 changed files
with
258 additions
and
151 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
20 changes: 11 additions & 9 deletions
20
core/src/main/java/com/theagilemonkeys/ellmental/core/schema/Embedding.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
package com.theagilemonkeys.ellmental.core.schema; | ||
|
||
import java.util.List; | ||
|
||
public class Embedding { | ||
|
||
public Embedding(List<Double> vector) { | ||
this.vector = vector; | ||
} | ||
public List<Double> vector; | ||
|
||
} | ||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
/** | ||
* Embeddings represent a point in the embeddings space, representing the semantics of a given text. | ||
*/ | ||
public record Embedding( | ||
UUID id, | ||
List<Double> vector, | ||
Map<String, String> metadata | ||
) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.