Skip to content

Commit

Permalink
Add RankAnswers API
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Apr 1, 2024
1 parent 6db83d1 commit b7aa7f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 6 additions & 6 deletions MyApp.ServiceInterface/Data/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public static (string Model, int Questions)[] ModelsForQuestions =
("phi", 0),
("gemma:2b", 0),
("gemma", 3),
("mixtral", 10),
("gemini-pro", 20),
("claude-3-sonnet-20240229", 50),
("mixtral", 5),
("gemini-pro", 10),
("claude-3-sonnet-20240229", 25),
("gpt-4-turbo-preview", 50),
("claude-3-opus-20240229", 100),
#else
Expand All @@ -38,9 +38,9 @@ public static (string Model, int Questions)[] ModelsForQuestions =
("deepseek-coder:6.7b", 0),
("mistral", 0),
("gemma", 3),
("mixtral", 10),
// ("gemini-pro", 20),
// ("claude-3-sonnet-20240229", 50),
("mixtral", 5),
// ("gemini-pro", 10),
// ("claude-3-sonnet-20240229", 25),
// ("gpt-4-turbo-preview", 50),
// ("claude-3-opus-20240229", 100),
#endif
Expand Down
9 changes: 8 additions & 1 deletion MyApp.ServiceInterface/QuestionServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public async Task<object> Any(GetAnswerBody request)
}
}

public async Task Any(CreateWorkerAnswer request)
public async Task<object> Any(CreateWorkerAnswer request)
{
var json = request.Json;
if (string.IsNullOrEmpty(json))
Expand Down Expand Up @@ -275,6 +275,13 @@ public async Task Any(CreateWorkerAnswer request)
await questions.SaveModelAnswerAsync(request.PostId, request.Model, json);

answerNotifier.NotifyNewAnswer(request.PostId, request.Model);

return new IdResponse { Id = $"{request.PostId}" };
}

public async Task<object> Any(RankAnswers request)
{
return new IdResponse { Id = $"{request.PostId}" };
}

public async Task<object> Any(CreateComment request)
Expand Down

0 comments on commit b7aa7f6

Please sign in to comment.