Repository: microsoft/semantic-kernel
File: dotnet/src/Connectors/Connectors.OpenAI/Extensions/OpenAIServiceCollectionExtensions.DependencyInjection.cs (C#)

Code before:
    /// <param name="apiKey">OpenAI API key, see https://platform.openai.com/account/api-keys</param>
    /// <param name="orgId">OpenAI organization id. This is usually optional unless your account belongs to multiple organizations.</param>
    /// <param name="serviceId">A local identifier for the given AI service</param>
    /// <param name="httpClient">The HttpClient to use with this service.</param>
    /// <param name="openTelemetrySourceName">An optional name for the OpenTelemetry source.</param>
    /// <param name="openTelemetryConfig">An optional callback that can be used to configure the <see cref="OpenTelemetryChatClient"/> instance.</param>
    /// <returns>The same instance as <paramref name="services"/>.</returns>
    public static IServiceCollection AddOpenAIChatClient(
        this IServiceCollection services,
        string modelId,
        Uri endpoint,
        string? apiKey = null,
        string? orgId = null,
        string? serviceId = null,
        HttpClient? httpClient = null,
        string? openTelemetrySourceName = null,
        Action<OpenTelemetryChatClient>? openTelemetryConfig = null)
    {
        Verify.NotNull(services);

        IChatClient Factory(IServiceProvider serviceProvider, object? _)
        {
            var loggerFactory = serviceProvider.GetService<ILoggerFactory>();

            // Get or create HttpClient with proper BaseAddress for the endpoint
            HttpClient clientHttpClient;
            if (httpClient is not null)
            {
                clientHttpClient = httpClient;
            }
            else
            {
                var defaultClient = HttpClientProvider.GetHttpClient(serviceProvider);
                // If using default client and it doesn't have BaseAddress set, create one with the endpoint
                if (defaultClient.BaseAddress is null)
                {
                    clientHttpClient = new HttpClient(new HttpClientHandler())
                    {
                        BaseAddress = endpoint
                    };
                }
                else
                {
                    clientHttpClient = defaultClient;
                }
            }

            var builder = new OpenAIClient(
                    credential: new ApiKeyCredential(apiKey ?? SingleSpace),
                    options: ClientCore.GetOpenAIClientOptions(
                        httpClient: clientHttpClient,

Review comment (suggestion):
Update the variable name, to avoid `client` `Client` redudancy.
```suggestion
            HttpClient innerHttpClient;
```

Code after:
    /// <param name="apiKey">OpenAI API key, see https://platform.openai.com/account/api-keys</param>
    /// <param name="orgId">OpenAI organization id. This is usually optional unless your account belongs to multiple organizations.</param>
    /// <param name="serviceId">A local identifier for the given AI service</param>
    /// <param name="httpClient">The HttpClient to use with this service.</param>
    /// <param name="openTelemetrySourceName">An optional name for the OpenTelemetry source.</param>
    /// <param name="openTelemetryConfig">An optional callback that can be used to configure the <see cref="OpenTelemetryChatClient"/> instance.</param>
    /// <returns>The same instance as <paramref name="services"/>.</returns>
    public static IServiceCollection AddOpenAIChatClient(
        this IServiceCollection services,
        string modelId,
        Uri endpoint,
        string? apiKey = null,
        string? orgId = null,
        string? serviceId = null,
        HttpClient? httpClient = null,
        string? openTelemetrySourceName = null,
        Action<OpenTelemetryChatClient>? openTelemetryConfig = null)
    {
        Verify.NotNull(services);

        IChatClient Factory(IServiceProvider serviceProvider, object? _)
        {
            var loggerFactory = serviceProvider.GetService<ILoggerFactory>();

            // Get or create HttpClient with proper BaseAddress for the endpoint
            HttpClient innerHttpClient;
            if (httpClient is not null)
            {
                innerHttpClient = httpClient;
            }
            else
            {
                var defaultClient = HttpClientProvider.GetHttpClient(serviceProvider);
                // If using default client and it doesn't have BaseAddress set or BaseAddress doesn't match the endpoint, create one with the endpoint
                if (defaultClient.BaseAddress is null || defaultClient.BaseAddress != endpoint)
                {
                    Verify.NotNull(endpoint);

                    // A new one needs to be created as we can't cross boundaries and modify an existing client 
                    innerHttpClient = HttpClientProvider.GetHttpClient();
                    innerHttpClient.BaseAddress = endpoint;
                }
                else
                {
                    innerHttpClient = defaultClient;
                }
            }

            var builder = new OpenAIClient(
                    credential: new ApiKeyCredential(apiKey ?? SingleSpace),
                    options: ClientCore.GetOpenAIClientOptions(