Skip to content

Commit

Permalink
Refactoring #43
Browse files Browse the repository at this point in the history
  • Loading branch information
marcominerva committed Feb 12, 2024
1 parent 371e97d commit 9244e5f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 48 deletions.
27 changes: 0 additions & 27 deletions src/ChatGptNet/ChatGptClientFactoryBuilder.cs

This file was deleted.

3 changes: 2 additions & 1 deletion src/ChatGptNet/ChatGptFactoryServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Extensions.DependencyInjection;

namespace ChatGptNet;

/// <summary>
/// Provides extension methods for adding ChatGPT Client Factory support in NET applications.
/// </summary>
Expand All @@ -27,7 +28,7 @@ private static IServiceCollection AddChatGptClientFactoryCore(this IServiceColle
services.AddMemoryCache();
services.AddSingleton<IChatGptCache, ChatGptMemoryCache>();

var httpClientBuilder = services.AddHttpClient<IChatGptClientFactory, ChatGptClientFactory>();
services.AddHttpClient();
services.AddSingleton<IChatGptClientFactory, ChatGptClientFactory>(
serviceProvider => new ChatGptClientFactory(serviceProvider, serviceProvider.GetRequiredService<IChatGptCache>(), deafultOptions)
);
Expand Down
2 changes: 1 addition & 1 deletion src/ChatGptNet/ChatGptOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ internal ChatGptOptionsBuilder(ChatGptOptionsBuilder source)
ApiVersion = azure.ApiVersion,
AuthenticationType = azure.AuthenticationType
},
_ => throw new ArgumentException("Invalid service configuration type.")
_ => null!
};

User = source.User;
Expand Down
19 changes: 0 additions & 19 deletions src/ChatGptNet/IChatGptClientFactoryBuilder.cs

This file was deleted.

0 comments on commit 9244e5f

Please sign in to comment.