AspireConfigurableOpenAIExtensions.AddOpenAIClientFromConfiguration Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Registers OpenAI.OpenAIClient or AzureOpenAIClient as a singleton in the services provided by the builder
.
The concrete implementation is selected automatically from configuration.
public static void AddOpenAIClientFromConfiguration (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string connectionName);
static member AddOpenAIClientFromConfiguration : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string -> unit
<Extension()>
Public Sub AddOpenAIClientFromConfiguration (builder As IHostApplicationBuilder, connectionName As String)
Parameters
- builder
- IHostApplicationBuilder
The IHostApplicationBuilder to read config from and add services to.
- connectionName
- String
A name used to retrieve the connection string from the ConnectionStrings configuration section.