mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-02-11 19:49:06 +00:00
36 lines
887 B
C#
36 lines
887 B
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace AIStudio.Tools.ERIClient;
|
|
|
|
public abstract class ERIClientBase(string baseAddress) : IDisposable
|
|
{
|
|
protected static readonly JsonSerializerOptions JSON_OPTIONS = new()
|
|
{
|
|
WriteIndented = true,
|
|
AllowTrailingCommas = true,
|
|
PropertyNamingPolicy = null,
|
|
DictionaryKeyPolicy = JsonNamingPolicy.CamelCase,
|
|
PropertyNameCaseInsensitive = true,
|
|
Converters =
|
|
{
|
|
new JsonStringEnumConverter(JsonNamingPolicy.SnakeCaseUpper),
|
|
}
|
|
};
|
|
|
|
protected readonly HttpClient httpClient = new()
|
|
{
|
|
BaseAddress = new Uri(baseAddress),
|
|
};
|
|
|
|
protected string securityToken = string.Empty;
|
|
|
|
#region Implementation of IDisposable
|
|
|
|
public void Dispose()
|
|
{
|
|
this.httpClient.Dispose();
|
|
}
|
|
|
|
#endregion
|
|
} |