Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: HomeAutomation AzureOpenAI Configuration Fix #10054

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace HomeAutomation.Options;
/// </summary>
public sealed class AzureOpenAIOptions
{
public const string SectionName = "AzureOpenAI";

[Required]
public string ChatDeploymentName { get; set; } = string.Empty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace HomeAutomation.Options;
/// </summary>
public sealed class OpenAIOptions
{
public const string SectionName = "OpenAI";

[Required]
public string ChatModelId { get; set; } = string.Empty;

Expand Down
2 changes: 1 addition & 1 deletion dotnet/samples/Demos/HomeAutomation/Program.cs
RogerBarreto marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal static async Task Main(string[] args)

// Get configuration
builder.Services.AddOptions<AzureOpenAIOptions>()
.Bind(builder.Configuration.GetSection(nameof(AzureOpenAIOptions)))
.Bind(builder.Configuration.GetSection(AzureOpenAIOptions.SectionName))
.ValidateDataAnnotations()
.ValidateOnStart();

Expand Down
Loading