mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-04 16:09:40 +00:00
Added an agent to select the appropriate data sources for any prompt (#284)
This commit is contained in:
1 parent
657fda4961
commit
98810ce884
23 files changed
+802
-21
No files matched your search
@@ -21,6 +21,7 @@ internal sealed class Program
|
||||
public static RustService RUST_SERVICE = null!;
|
||||
public static Encryption ENCRYPTION = null!;
|
||||
public static string API_TOKEN = null!;
|
||||
public static IServiceProvider SERVICE_PROVIDER = null!;
|
||||
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
@@ -117,6 +118,7 @@ internal sealed class Program
|
||||
builder.Services.AddSingleton<ThreadSafeRandom>();
|
||||
builder.Services.AddSingleton<DataSourceService>();
|
||||
builder.Services.AddTransient<HTMLParser>();
|
||||
builder.Services.AddTransient<AgentDataSourceSelection>();
|
||||
builder.Services.AddTransient<AgentTextContentCleaner>();
|
||||
builder.Services.AddHostedService<UpdateService>();
|
||||
builder.Services.AddHostedService<TemporaryChatService>();
|
||||
@@ -148,6 +150,10 @@ internal sealed class Program
|
||||
var programLogger = app.Services.GetRequiredService<ILogger<Program>>();
|
||||
programLogger.LogInformation("Starting the AI Studio server.");
|
||||
|
||||
// Store the service provider (DI). We need it later for some classes,
|
||||
// which are not part of the request pipeline:
|
||||
SERVICE_PROVIDER = app.Services;
|
||||
|
||||
// Initialize the encryption service:
|
||||
programLogger.LogInformation("Initializing the encryption service.");
|
||||
var encryptionLogger = app.Services.GetRequiredService<ILogger<Encryption>>();
|
||||
@@ -196,5 +202,8 @@ internal sealed class Program
|
||||
};
|
||||
|
||||
await serverTask;
|
||||
|
||||
RUST_SERVICE.Dispose();
|
||||
programLogger.LogInformation("The AI Studio server was stopped.");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user