Consolidate AzureOpenAi namespace.
This commit is contained in:
parent
aaa9261ac5
commit
0b31f7cfee
|
|
@ -6,13 +6,13 @@ using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace BotSharp.Core;
|
namespace BotSharp.Core;
|
||||||
|
|
||||||
public static class AzureAiServiceCollectionExtensions
|
public static class AzureOpenAiServiceCollectionExtensions
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddAzureOpenAiPlatform(this IServiceCollection services, IConfiguration config)
|
public static IServiceCollection AddAzureOpenAiPlatform(this IServiceCollection services, IConfiguration config)
|
||||||
{
|
{
|
||||||
services.AddSingleton(x =>
|
services.AddSingleton(x =>
|
||||||
{
|
{
|
||||||
var settings = new AzureAiSettings();
|
var settings = new AzureOpenAiSettings();
|
||||||
config.Bind("AzureAi", settings);
|
config.Bind("AzureAi", settings);
|
||||||
return settings;
|
return settings;
|
||||||
});
|
});
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace BotSharp.Platform.AzureAi;
|
namespace BotSharp.Platform.AzureAi;
|
||||||
|
|
||||||
public class AzureAiSettings
|
public class AzureOpenAiSettings
|
||||||
{
|
{
|
||||||
public string ApiKey { get; set; } = string.Empty;
|
public string ApiKey { get; set; } = string.Empty;
|
||||||
public string Endpoint { get; set; } = string.Empty;
|
public string Endpoint { get; set; } = string.Empty;
|
||||||
|
|
@ -12,9 +12,9 @@ namespace BotSharp.Plugin.AzureOpenAI.TextGeneratives;
|
||||||
|
|
||||||
public class ChatCompletionProvider : IChatCompletionProvider
|
public class ChatCompletionProvider : IChatCompletionProvider
|
||||||
{
|
{
|
||||||
private readonly AzureAiSettings _settings;
|
private readonly AzureOpenAiSettings _settings;
|
||||||
|
|
||||||
public ChatCompletionProvider(AzureAiSettings settings)
|
public ChatCompletionProvider(AzureOpenAiSettings settings)
|
||||||
{
|
{
|
||||||
_settings = settings;
|
_settings = settings;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
"NumberOfGpuLayer": 10
|
"NumberOfGpuLayer": 10
|
||||||
},
|
},
|
||||||
|
|
||||||
"AzureAi": {
|
"AzureOpenAi": {
|
||||||
"ApiKey": "",
|
"ApiKey": "",
|
||||||
"Endpoint": "",
|
"Endpoint": "",
|
||||||
"InstructionFile": "Prompts\\chat-with-bob.txt",
|
"InstructionFile": "Prompts\\chat-with-bob.txt",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue