Skip to content

Commit

Permalink
cleanup MusicTypeChat
Browse files Browse the repository at this point in the history
mythz committed Sep 16, 2023
1 parent da7c60c commit 6b13d48
Showing 53 changed files with 174 additions and 3,388 deletions.
20 changes: 0 additions & 20 deletions MusicTypeChat.ServiceInterface/Data/Contact.cs

This file was deleted.

2 changes: 1 addition & 1 deletion MusicTypeChat.ServiceInterface/MusicService.cs
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ public async Task<object> Post(ProcessSpotifyCommand request)
private async Task<object> ProcessStep<T>(TypeChatStep step, T prog) where T : TypeChatProgramBase,new()
{
var func = step.Func;
var args = step.Args ?? new List<object>();
var args = step.Args ?? new();
var method = typeof(T).GetMethod(func);

if (method == null)
24 changes: 0 additions & 24 deletions MusicTypeChat.ServiceInterface/MyServices.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using ServiceStack;
using MusicTypeChat.ServiceModel;
using MusicTypeChat.ServiceModel.Types;
using ServiceStack.Gpt;
using ServiceStack.OrmLite;
using ServiceStack.Text;
@@ -14,26 +13,6 @@ public object Any(Hello request)
{
return new HelloResponse { Result = $"Hello, {request.Name}!" };
}

public async Task<object> Any(AdminData request)
{
var tables = new (string Label, Type Type)[]
{
("Bookings", typeof(Booking)),
("Coupons", typeof(Coupon)),
};
var dialect = Db.GetDialectProvider();
var totalSql = tables.Map(x => $"SELECT '{x.Label}', COUNT(*) FROM {dialect.GetQuotedTableName(x.Type.GetModelMetadata())}")
.Join(" UNION ");
var results = await Db.DictionaryAsync<string,int>(totalSql);

return new AdminDataResponse {
PageStats = tables.Map(x => new PageStats {
Label = x.Label,
Total = results[x.Label],
})
};
}

public ISpeechToText SpeechToText { get; set; }
public IAutoQueryDb AutoQuery { get; set; }
@@ -83,9 +62,6 @@ void WriteJsonFile(string path, string json)
catch (Exception ignore) {}
});
}



}


14 changes: 4 additions & 10 deletions MusicTypeChat.ServiceInterface/PromptProvider.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
using System.Diagnostics;
using MusicTypeChat.ServiceModel;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.AI.ChatCompletion;
using MusicTypeChat.ServiceModel;
using ServiceStack;
using ServiceStack;
using ServiceStack.Gpt;
using ServiceStack.Script;
using ServiceStack.Text;

namespace MusicTypeChat.ServiceInterface;

public class MusicChatPromptProvider : IPromptProvider
public class MusicPromptProvider : IPromptProvider
{
public AppConfig Config { get; set; }

public MusicChatPromptProvider(AppConfig config)
public MusicPromptProvider(AppConfig config)
{
Config = config;
}
@@ -88,4 +82,4 @@ public class SiteConfig
public string Bucket { get; set; }
public string RecognizerId { get; set; }
public string PhraseSetId { get; set; }
}
}
39 changes: 0 additions & 39 deletions MusicTypeChat.ServiceInterface/TodosServices.cs

This file was deleted.

179 changes: 0 additions & 179 deletions MusicTypeChat.ServiceModel/Bookings.cs

This file was deleted.

Loading

0 comments on commit 6b13d48

Please sign in to comment.