Skip to content

Commit

Permalink
Typo fixes in JandexUtil and EmbeddingStoreJsonRPCService
Browse files Browse the repository at this point in the history
  • Loading branch information
rsvoboda committed Dec 23, 2024
1 parent b7f861a commit 6e36903
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private static List<Type> mapTypeArguments(Type appliedType, List<Type> typeArgu
// figure out which arguments we passed to the supertype
List<Type> appliedArguments;

// we passed them explicitely
// we passed them explicitly
if (appliedType.kind() == Type.Kind.PARAMETERIZED_TYPE) {
appliedArguments = appliedType.asParameterizedType().arguments();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public EmbeddingStoreJsonRPCService(
private static final Pattern COMMA_OR_NEWLINE = Pattern.compile(",|\\r?\\n");

public String add(String id, String text, String metadata) {
verifyEmbedingModelAndStore();
verifyEmbeddingModelAndStore();
if (id == null || id.isEmpty()) {
return embeddingStore.add(embeddingModel.embed(text).content(), TextSegment.from(text, parseMetadata(metadata)));
} else {
Expand All @@ -96,7 +96,7 @@ private Metadata parseMetadata(String metadata) {
// FIXME: the limit argument can be changed to int after https://github.com/quarkusio/quarkus/issues/37481 is fixed
// LangChain4jDevUIJsonRpcTest will need to be adjusted accordingly
public JsonArray findRelevant(String text, String limit) {
verifyEmbedingModelAndStore();
verifyEmbeddingModelAndStore();
int limitInt = Integer.parseInt(limit);
JsonArray result = new JsonArray();
for (EmbeddingMatch<TextSegment> match : embeddingStore.findRelevant(embeddingModel.embed(text).content(), limitInt)) {
Expand All @@ -119,7 +119,7 @@ public JsonArray findRelevant(String text, String limit) {
return result;
}

private void verifyEmbedingModelAndStore() {
private void verifyEmbeddingModelAndStore() {
if (embeddingModel == null) {
throw new RuntimeException("No embedding model found in CDI. Please add an embedding model to your application.");
}
Expand Down

0 comments on commit 6e36903

Please sign in to comment.