VeeFriends Character Quotes and Quiz Generator
$ dotnet add package VeeFriends.Character.QuotesGenerate quotes and quizzes for VeeFriends characters using AI.
$ dotnet add package VeeFriends.Character.Quotes
This package provides services for generating character-specific quotes and quizzes for VeeFriends characters using AI. It's designed to be used with your own OpenAI API key.
CharacterQuoteService and CharacterQuizServiceIn your Startup.cs or Program.cs, add the following:
services.AddVeeFriendsCharacters();
services.AddCharacterQuoteService(options => options.ApiKey = "your-openai-api-key");
services.AddCharacterQuizService(options => options.ApiKey = "your-openai-api-key");
public class QuoteGenerator
{
private readonly CharacterQuoteService _quoteService;
public QuoteGenerator(CharacterQuoteService quoteService)
{
_quoteService = quoteService;
}
public async Task<string> GetQuoteOfTheDay(string characterName)
{
var quote = await _quoteService.GenerateMessageOfTheDay(characterName, CancellationToken.None);
return quote;
}
}
public class QuizGenerator
{
private readonly CharacterQuizService _quizService;
public QuizGenerator(CharacterQuizService quizService)
{
_quizService = quizService;
}
public async Task<QuizAiResult> GenerateQuiz()
{
var quiz = await _quizService.GenerateQuestions(CancellationToken.None);
return quiz;
}
}
The package uses the following main models:
public class QuizAiResult
{
public List<QuizQuestion> Quiz { get; set; }
}
public class QuizQuestion
{
public string Question { get; set; }
public List<QuizAnswer> Answers { get; set; }
}
public class QuizAnswer
{
public string Answer { get; set; }
public string Trait { get; set; }
}
VeeFriends.Characters for character information.Feel free to explore the other methods available in CharacterQuoteService and CharacterQuizService.
This project is licensed under the MIT License - see the LICENSE file for details.