Skip to content

Commit b3fb014

Browse files
author
Igor Evdokimov
committed
- Auth Type choice is available for GPT
1 parent 55c55dd commit b3fb014

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

Botticelli.AI.YaGpt/Settings/YaGptSettings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ namespace Botticelli.AI.YaGpt.Settings;
44

55
public class YaGptSettings : AiSettings
66
{
7-
public string ApiKey { get; set; }
87
public string Model { get; set; }
98
public double Temperature { get; set; }
109
public string Instruction { get; set; }

Botticelli.AI/AIProvider/ChatGptProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private HttpClient GetClient()
9595

9696
client.BaseAddress = new Uri(Settings.Value.Url);
9797
client.DefaultRequestHeaders.Authorization =
98-
new AuthenticationHeaderValue("Bearer", Settings.Value.ApiKey);
98+
new AuthenticationHeaderValue(Settings.Value.AuthMethod, Settings.Value.ApiKey);
9999

100100
return client;
101101
}

Botticelli.AI/Settings/AISettings.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
public class AiSettings : ProviderSettings
44
{
55
public string? Url { get; set; }
6-
public string AiName { get; set; }
6+
public required string AiName { get; set; }
77
public bool StreamGeneration { get; set; }
8-
public string ApiKey { get; set; }
8+
public string AuthMethod { get; set; } = "Bearer";
9+
public string? ApiKey { get; set; }
910
}

0 commit comments

Comments
 (0)