-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.cs
29 lines (25 loc) · 901 Bytes
/
Config.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public class Config
{
public const string OpenAI = "OPENAI";
public const string AzureOpenAI = "AZUREOPENAI";
public string AIService { get; set; } = string.Empty;
public string DeploymentOrModelId { get; set; } = string.Empty;
public string Endpoint { get; set; } = string.Empty;
public string Key { get; set; } = string.Empty;
public bool IsValid()
{
switch (this.AIService.ToUpperInvariant())
{
case OpenAI:
return
!string.IsNullOrEmpty(this.DeploymentOrModelId) &&
!string.IsNullOrEmpty(this.Key);
case AzureOpenAI:
return
!string.IsNullOrEmpty(this.Endpoint) &&
!string.IsNullOrEmpty(this.DeploymentOrModelId) &&
!string.IsNullOrEmpty(this.Key);
}
return false;
}
}