mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-02-11 09:29:07 +00:00
Defined a base provider to handle http client & base address
This commit is contained in:
parent
36fb450fad
commit
f9c87fc72c
22
app/MindWork AI Studio/Provider/BaseProvider.cs
Normal file
22
app/MindWork AI Studio/Provider/BaseProvider.cs
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user