Skip to content

Commit

Permalink
Upgrade to com.azure:azure-ai-openai 1.0.0-beta.8 (#991)
Browse files Browse the repository at this point in the history
Fix #989
  • Loading branch information
jdubois committed Apr 29, 2024
1 parent 0ae7f0a commit cd80a88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Expand Up @@ -20,6 +20,7 @@
import java.util.ArrayList;
import java.util.List;

import static dev.langchain4j.data.embedding.Embedding.from;
import static dev.langchain4j.internal.Utils.getOrDefault;
import static dev.langchain4j.model.azure.InternalAzureOpenAiHelper.setupOpenAIClient;
import static dev.langchain4j.spi.ServiceHelper.loadFactories;
Expand Down Expand Up @@ -157,14 +158,6 @@ private Response<List<Embedding>> embedTexts(List<String> texts) {
);
}

private static Embedding from(List<Double> vector) {
float[] langChainVector = new float[vector.size()];
for (int index = 0; index < vector.size(); index++) {
langChainVector[index] = vector.get(index).floatValue();
}
return Embedding.from(langChainVector);
}

@Override
public int estimateTokenCount(String text) {
return tokenizer.estimateTokenCountInText(text);
Expand Down
2 changes: 1 addition & 1 deletion langchain4j-parent/pom.xml
Expand Up @@ -19,7 +19,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>1714382357</project.build.outputTimestamp>
<openai4j.version>0.17.0</openai4j.version>
<azure-ai-openai.version>1.0.0-beta.7</azure-ai-openai.version>
<azure-ai-openai.version>1.0.0-beta.8</azure-ai-openai.version>
<azure-ai-search.version>11.6.4</azure-ai-search.version>
<azure.storage-blob.version>12.25.4</azure.storage-blob.version>
<azure.storage-common.version>12.24.4</azure.storage-common.version>
Expand Down

0 comments on commit cd80a88

Please sign in to comment.