Defined a base provider to handle http client & base address

This commit is contained in:
tsommer committed 2024-05-04 10:59:13 +02:00
1 parent 36fb450fad
commit f9c87fc72c
1 file changed
+22
@@ -0,0 +1,22 @@
namespace AIStudio.Provider;
/// <summary>
/// The base class for all providers.
/// </summary>
public abstract class BaseProvider
{
/// <summary>
/// The HTTP client to use for all requests.
/// </summary>
protected readonly HttpClient httpClient = new();
/// <summary>
/// Constructor for the base provider.
/// </summary>
/// <param name="url">The base URL for the provider.</param>
protected BaseProvider(string url)
{
// Set the base URL:
this.httpClient.BaseAddress = new(url);
}
}