AspireConfigurableOpenAIExtensions.AddKeyedOpenAIClientFromConfiguration 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 as a singleton in the services provided by the builder
.
The concrete implementation is selected automatically from configuration.
public static void AddKeyedOpenAIClientFromConfiguration(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string name);
static member AddKeyedOpenAIClientFromConfiguration : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string -> unit
<Extension()>
Public Sub AddKeyedOpenAIClientFromConfiguration (builder As IHostApplicationBuilder, name As String)
Parameters
- builder
- IHostApplicationBuilder
The IHostApplicationBuilder to read config from and add services to.
- name
- String
The name of the component, which is used as the ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section.