Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Layoric committed Feb 6, 2024
1 parent eab37e7 commit 142ff6f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion TypeChatExamples/Configure.AutoQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public void Configure(IWebHostBuilder builder) => builder
.ConfigureServices(services => {
// Enable Audit History
services.AddSingleton<ICrudEvents>(c =>
new OrmLiteCrudEvents(c.Resolve<IDbConnectionFactory>()));
new OrmLiteCrudEvents(c.GetRequiredService<IDbConnectionFactory>()));
})
.ConfigureAppHost(appHost => {

Expand Down
14 changes: 7 additions & 7 deletions TypeChatExamples/Configure.Gpt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ public void Configure(IWebHostBuilder builder) => builder
services.AddSingleton<MusicPromptProvider>();
services.AddSingleton<IPromptProviderFactory>(c => new PromptProviderFactory {
Providers = {
[Tags.CoffeeShop] = c.Resolve<CoffeeShopPromptProvider>(),
[Tags.Sentiment] = c.Resolve<SentimentPromptProvider>(),
[Tags.Calendar] = c.Resolve<CalendarPromptProvider>(),
[Tags.Restaurant] = c.Resolve<RestaurantPromptProvider>(),
[Tags.Math] = c.Resolve<MathPromptProvider>(),
[Tags.Music] = c.Resolve<MusicPromptProvider>(),
[Tags.CoffeeShop] = c.GetRequiredService<CoffeeShopPromptProvider>(),
[Tags.Sentiment] = c.GetRequiredService<SentimentPromptProvider>(),
[Tags.Calendar] = c.GetRequiredService<CalendarPromptProvider>(),
[Tags.Restaurant] = c.GetRequiredService<RestaurantPromptProvider>(),
[Tags.Math] = c.GetRequiredService<MathPromptProvider>(),
[Tags.Music] = c.GetRequiredService<MusicPromptProvider>(),
}
});

Expand All @@ -38,7 +38,7 @@ public void Configure(IWebHostBuilder builder) => builder
Environment.GetEnvironmentVariable("OPENAI_API_KEY")!)
.Build();
services.AddSingleton(kernel);
services.AddSingleton<ITypeChat>(c => new KernelTypeChat(c.Resolve<IKernel>()));
services.AddSingleton<ITypeChat>(c => new KernelTypeChat(c.GetRequiredService<IKernel>()));
}
else if (gptProvider == nameof(NodeTypeChat))
{
Expand Down
12 changes: 6 additions & 6 deletions TypeChatExamples/Configure.Speech.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public void Configure(IWebHostBuilder builder) => builder
{
Resolve = feature =>
{
var config = c.Resolve<AppConfig>();
var gcp = c.Resolve<GoogleCloudConfig>();
var config = c.GetRequiredService<AppConfig>();
var gcp = c.GetRequiredService<GoogleCloudConfig>();
var siteConfig = config.GetSiteConfig(feature);

return new GoogleCloudSpeechToText(
Expand All @@ -48,8 +48,8 @@ public void Configure(IWebHostBuilder builder) => builder
{
Resolve = feature =>
{
var config = c.Resolve<AppConfig>();
var aws = c.Resolve<AwsConfig>();
var config = c.GetRequiredService<AppConfig>();
var aws = c.GetRequiredService<AwsConfig>();
var siteConfig = config.GetSiteConfig(feature);

return new AwsSpeechToText(
Expand All @@ -64,7 +64,7 @@ public void Configure(IWebHostBuilder builder) => builder
else if (speechProvider == nameof(AzureSpeechToText))
{
services.AddSingleton<ISpeechToText>(c =>
new AzureSpeechToText(c.Resolve<AzureConfig>().ToSpeechConfig()));
new AzureSpeechToText(c.GetRequiredService<AzureConfig>().ToSpeechConfig()));
}
else if (speechProvider == nameof(WhisperApiSpeechToText))
{
Expand All @@ -73,7 +73,7 @@ public void Configure(IWebHostBuilder builder) => builder
else if (speechProvider == nameof(WhisperLocalSpeechToText))
{
services.AddSingleton<ISpeechToText>(c => {
var config = c.Resolve<AppConfig>();
var config = c.GetRequiredService<AppConfig>();
return new WhisperLocalSpeechToText {
WhisperPath = config.WhisperPath ?? ProcessUtils.FindExePath("whisper"),
TimeoutMs = config.NodeProcessTimeoutMs,
Expand Down

0 comments on commit 142ff6f

Please sign in to comment.