Skip to content

Commit

Permalink
Add Gemini Pro, GPT4-turbo and Claude models
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Mar 31, 2024
1 parent acd8416 commit 6db83d1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
15 changes: 10 additions & 5 deletions MyApp.ServiceInterface/Data/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ public class AppConfig
public HashSet<string> AllTags { get; set; } = [];
public List<ApplicationUser> ModelUsers { get; set; } = [];

public (string Model, int Questions)[] ModelsForQuestions =
public static (string Model, int Questions)[] ModelsForQuestions =
[
#if DEBUG
("phi", 0),
("gemma:2b", 0),
("gemma", 3),
("mixtral", 10),
("gemini-pro", 20),
("claude-3-sonnet-20240229", 50),
("gpt-4-turbo-preview", 50),
("claude-3-opus-20240229", 100),
#else
("phi", 0),
("gemma:2b", 0),
Expand All @@ -35,13 +39,14 @@ public class AppConfig
("mistral", 0),
("gemma", 3),
("mixtral", 10),
// ("gpt4-turbo", 30),
// ("gemini-pro", 50),
// ("claude-opus", 100),
// ("gemini-pro", 20),
// ("claude-3-sonnet-20240229", 50),
// ("gpt-4-turbo-preview", 50),
// ("claude-3-opus-20240229", 100),
#endif
];

public int[] QuestionLevels = [0, 3, 10]; //, 30, 50, 100
public static int[] QuestionLevels = ModelsForQuestions.Select(x => x.Questions).Distinct().OrderBy(x => x).ToArray();

public ApplicationUser DefaultUser { get; set; } = new()
{
Expand Down
2 changes: 1 addition & 1 deletion MyApp/Components/Pages/Questions/Ask.razor
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<p class="my-2 text-sm text-gray-500">ask more questions to unlock new assistants</p>
@foreach (var questionLevel in AppConfig.QuestionLevels)
{
var qualified = totalQuestions >= questionLevel;
var qualified = totalQuestions >= questionLevel || HttpContext.User.HasRole(Roles.Moderator);
@if (questionLevel > 0)
{
<p class="my-4 text-center font-semibold text-gray-500">
Expand Down
40 changes: 40 additions & 0 deletions MyApp/Configure.Db.Migrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,46 @@ await EnsureUserAsync(new ApplicationUser
Model = "mixtral", //47B
}, "p@55wOrd");

await EnsureUserAsync(new ApplicationUser
{
UserName = "gemini-pro",
Email = "[email protected]",
DisplayName = "Gemini Pro",
EmailConfirmed = true,
ProfilePath = "/profiles/ge/gemini-pro/gemini-pro.svg",
Model = "gemini-pro",
}, "p@55wOrd");

await EnsureUserAsync(new ApplicationUser
{
UserName = "gpt4-turbo",
Email = "[email protected]",
DisplayName = "GPT-4 Turbo",
EmailConfirmed = true,
ProfilePath = "/profiles/gp/gpt4-turbo/gpt4-turbo.svg",
Model = "gpt-4-turbo-preview",
}, "p@55wOrd");

await EnsureUserAsync(new ApplicationUser
{
UserName = "claude-3-sonnet",
Email = "[email protected]",
DisplayName = "Claude 3 Sonnet",
EmailConfirmed = true,
ProfilePath = "/profiles/cl/claude-3-sonnet/claude-3-sonnet.svg",
Model = "claude-3-sonnet-20240229",
}, "p@55wOrd");

await EnsureUserAsync(new ApplicationUser
{
UserName = "claude-3-opus",
Email = "[email protected]",
DisplayName = "Claude 3 Opus",
EmailConfirmed = true,
ProfilePath = "/profiles/cl/claude-3-opus/claude-3-opus.svg",
Model = "claude-3-opus-20240229",
}, "p@55wOrd");

await EnsureUserAsync(new ApplicationUser
{
UserName = "servicestack",
Expand Down

0 comments on commit 6db83d1

Please sign in to comment.