Udate azure open ai client ot 1.0.0-beta8.
- In ITs rename property spring.ai.azure.openai.chat.options.model to spring.ai.azure.openai.chat.options.deployment-name. - Resolve compilation issues after the client library update.
This commit is contained in:
@@ -112,9 +112,10 @@ public class AzureOpenAiEmbeddingClient extends AbstractEmbeddingClient {
|
||||
private List<Embedding> generateEmbeddingList(List<EmbeddingItem> nativeData) {
|
||||
List<Embedding> data = new ArrayList<>();
|
||||
for (EmbeddingItem nativeDatum : nativeData) {
|
||||
List<Double> nativeDatumEmbedding = nativeDatum.getEmbedding();
|
||||
List<Float> nativeDatumEmbedding = nativeDatum.getEmbedding();
|
||||
int nativeIndex = nativeDatum.getPromptIndex();
|
||||
Embedding embedding = new Embedding(nativeDatumEmbedding, nativeIndex);
|
||||
Embedding embedding = new Embedding(nativeDatumEmbedding.stream().map(f -> f.doubleValue()).toList(),
|
||||
nativeIndex);
|
||||
data.add(embedding);
|
||||
}
|
||||
return data;
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -122,7 +122,7 @@
|
||||
<spring-boot.version>3.2.4</spring-boot.version>
|
||||
<spring-framework.version>6.1.4</spring-framework.version>
|
||||
<stringtemplate.version>4.0.2</stringtemplate.version>
|
||||
<azure-open-ai-client.version>1.0.0-beta.7</azure-open-ai-client.version>
|
||||
<azure-open-ai-client.version>1.0.0-beta.8</azure-open-ai-client.version>
|
||||
<jtokkit.version>1.0.0</jtokkit.version>
|
||||
<victools.version>4.31.1</victools.version>
|
||||
<bedrockruntime.version>2.25.3</bedrockruntime.version>
|
||||
|
||||
@@ -54,7 +54,7 @@ class FunctionCallWithFunctionBeanIT {
|
||||
|
||||
@Test
|
||||
void functionCallTest() {
|
||||
contextRunner.withPropertyValues("spring.ai.azure.openai.chat.options.model=gpt-4-0125-preview")
|
||||
contextRunner.withPropertyValues("spring.ai.azure.openai.chat.options..deployment-name=gpt-4-0125-preview")
|
||||
.run(context -> {
|
||||
|
||||
ChatClient chatClient = context.getBean(AzureOpenAiChatClient.class);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class FunctionCallWithFunctionWrapperIT {
|
||||
|
||||
@Test
|
||||
void functionCallTest() {
|
||||
contextRunner.withPropertyValues("spring.ai.azure.openai.chat.options.model=gpt-4-0125-preview")
|
||||
contextRunner.withPropertyValues("spring.ai.azure.openai.chat.options.deployment-name=gpt-4-0125-preview")
|
||||
.run(context -> {
|
||||
|
||||
AzureOpenAiChatClient chatClient = context.getBean(AzureOpenAiChatClient.class);
|
||||
|
||||
@@ -49,7 +49,7 @@ public class FunctionCallWithPromptFunctionIT {
|
||||
|
||||
@Test
|
||||
void functionCallTest() {
|
||||
contextRunner.withPropertyValues("spring.ai.azure.openai.chat.options.model=gpt-4-0125-preview")
|
||||
contextRunner.withPropertyValues("spring.ai.azure.openai.chat.options.deployment-name=gpt-4-0125-preview")
|
||||
.run(context -> {
|
||||
|
||||
AzureOpenAiChatClient chatClient = context.getBean(AzureOpenAiChatClient.class);
|
||||
|
||||
Reference in New Issue
Block a user