openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
OpenAI/src/Custom/Batch/BatchClientSettings.cs
20lines · modecode
| 1 | using Microsoft.Extensions.Configuration; |
| 2 | using System.ClientModel.Primitives; |
| 3 | using System.Diagnostics.CodeAnalysis; |
| 4 | |
| 5 | namespace OpenAI.Batch; |
| 6 | |
| 7 | [Experimental("SCME0002")] |
| 8 | public sealed class BatchClientSettings : ClientSettings |
| 9 | { |
| 10 | public OpenAIClientOptions Options { get; set; } |
| 11 | |
| 12 | protected override void BindCore(IConfigurationSection section) |
| 13 | { |
| 14 | var optionsSection = section.GetSection("Options"); |
| 15 | if (optionsSection.Exists()) |
| 16 | { |
| 17 | Options ??= new OpenAIClientOptions(optionsSection); |
| 18 | } |
| 19 | } |
| 20 | } |
| 21 | |