Skip to content

Commit

Permalink
Udate azure open ai client ot 1.0.0-beta8.
Browse files Browse the repository at this point in the history
   - 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.
  • Loading branch information
tzolov committed Apr 30, 2024
1 parent 9f32a3c commit 7252ba1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ private EmbeddingResponse generateEmbeddingResponse(Embeddings embeddings) {
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;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7252ba1

Please sign in to comment.