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:
Christian Tzolov
2024-04-30 15:44:16 +03:00
parent 9f32a3ca9c
commit 7252ba19f9
5 changed files with 7 additions and 6 deletions

View File

@@ -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;

View File

@@ -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>

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);