Skip to content

Commit 24f9ea8

Browse files
committed
Update Azure OpenAI SDK
2 parents 12b5fe4 + 7893a49 commit 24f9ea8

File tree

6 files changed

+116
-313
lines changed

6 files changed

+116
-313
lines changed

src/Azure.AISearch.FunctionApp.DotNet/Azure.AISearch.FunctionApp.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<UserSecretsId>aspnet-Azure.AISearch.FunctionApp-f7443d62-1b7f-4015-9c0f-643ec0cf8bf6</UserSecretsId>
88
</PropertyGroup>
99
<ItemGroup>
10-
<PackageReference Include="Azure.AI.OpenAI" Version="1.0.0-beta.7" />
11-
<PackageReference Include="Azure.Search.Documents" Version="11.5.0-beta.4" />
10+
<PackageReference Include="Azure.AI.OpenAI" Version="1.0.0-beta.12" />
11+
<PackageReference Include="Azure.Search.Documents" Version="11.5.0-beta.5" />
1212
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
1313
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
1414
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
1515
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
16-
<PackageReference Include="Microsoft.SemanticKernel" Version="0.23.230906.2-preview" />
16+
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-beta3" />
1717
</ItemGroup>
1818
<ItemGroup>
1919
<None Update="host.json">

src/Azure.AISearch.FunctionApp.DotNet/Services/AzureOpenAIEmbeddingService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public AzureOpenAIEmbeddingService(IConfiguration configuration)
1717

1818
public async Task<IReadOnlyList<float>> GetEmbeddingAsync(string embeddingDeploymentName, string text)
1919
{
20-
var response = await this.openAIClient.GetEmbeddingsAsync(embeddingDeploymentName, new EmbeddingsOptions(text));
21-
return response.Value.Data[0].Embedding;
20+
var response = await this.openAIClient.GetEmbeddingsAsync(new EmbeddingsOptions(embeddingDeploymentName, new[] { text }));
21+
return response.Value.Data[0].Embedding.ToArray();
2222
}
2323
}

src/Azure.AISearch.WebApp/Azure.AISearch.WebApp.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Azure.AI.OpenAI" Version="1.0.0-beta.8" />
11+
<PackageReference Include="Azure.AI.OpenAI" Version="1.0.0-beta.12" />
1212
<PackageReference Include="Azure.Search.Documents" Version="11.5.0-beta.5" />
13-
<PackageReference Include="Azure.Storage.Blobs" Version="12.18.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.24" />
13+
<PackageReference Include="Azure.Storage.Blobs" Version="12.19.1" />
14+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.25" />
1515
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
1616
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-beta3" />
1717
</ItemGroup>

src/Azure.AISearch.WebApp/Models/AzureOpenAIModels.cs

Lines changed: 0 additions & 209 deletions
This file was deleted.

src/Azure.AISearch.WebApp/Services/AzureOpenAIEmbeddingService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public AzureOpenAIEmbeddingService(AppSettings settings)
1818

1919
public async Task<IReadOnlyList<float>> GetEmbeddingAsync(string text)
2020
{
21-
var response = await this.openAIClient.GetEmbeddingsAsync(this.embeddingDeploymentName, new EmbeddingsOptions(text));
22-
return response.Value.Data[0].Embedding;
21+
var response = await this.openAIClient.GetEmbeddingsAsync(new EmbeddingsOptions(this.embeddingDeploymentName, new[] { text }));
22+
return response.Value.Data[0].Embedding.ToArray();
2323
}
2424
}

0 commit comments

Comments
 (0)