using var connection = new SqliteConnection(CONNECTION_STRING);
connection.Open();
using var cmd = connection.CreateCommand();
cmd.CommandText =
@"update series set description=@Description
where series_slug=@Slug";
var p1 = cmd.CreateParameter();
p1.ParameterName = "@Description";
p1.Value = description;
var p2 = cmd.CreateParameter();
p2.ParameterName = "@Slug";
p2.Value = slug;
cmd.Parameters.Add(p1);
cmd.Parameters.Add(p2);
cmd.ExecuteNonQuery();
}
private async Task GenerateDescriptions() {
var links = GetSeriesLinks();
var web = new HtmlWeb();
var api = new OpenAIAPI(config["openAiApiKey"]);
foreach (var slug in links.Keys) {
var sb = new StringBuilder();
sb.AppendLine(
@$"What follows are details about a radio show named ""{links[slug].Item1}"".
Please generate a two paragraph summary of the information.
The first paragraph should begin with the show's name without quotes, and focus on the show's premise, format, tone, and style. The first paragraph should not contain air dates, years, broadcast networks, or names of people involved in the show's production. The first paragraph should not describe the show as an ""old time radio show"" or mention the ""golden age of radio.""
The second paragraph can cover what years the show was broadcast, what radio networks the show aired on, how many episodes aired and are known to still exist today, interesting trivia including whether there were related TV shows or other media formats, notable advertisers and sponsors, and any notable actors and other people involved in the production if any of that information is contained in the provided details.