feat: добавил изменение промта для админа
Backend CI / build-and-test (push) Failing after 11m26s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Failing after 14m2s
Frontend CI / build-and-check (push) Failing after 19m55s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 14m7s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 14m59s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Failing after 15m0s
Backend CI / build-and-test (push) Failing after 11m26s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Failing after 14m2s
Frontend CI / build-and-check (push) Failing after 19m55s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 14m7s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 14m59s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Failing after 15m0s
This commit is contained in:
@@ -21,3 +21,7 @@ public record ReviewDto(
|
||||
public record CreateReviewRequest(int LectureId, ReviewRating Rating, string? Text);
|
||||
|
||||
public record UpdateReviewRequest(ReviewRating Rating, string? Text);
|
||||
|
||||
public record ReviewPromptDto(string Prompt, DateTime? UpdatedAt);
|
||||
|
||||
public record UpdateReviewPromptRequest(string Prompt);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
using UniVerse.Application.DTOs.Reviews;
|
||||
|
||||
namespace UniVerse.Application.Interfaces;
|
||||
|
||||
public interface IReviewPromptService
|
||||
{
|
||||
Task<ReviewPromptDto> GetAsync();
|
||||
Task<ReviewPromptDto> UpdateAsync(UpdateReviewPromptRequest request);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace UniVerse.Application.Prompts;
|
||||
|
||||
public static class ReviewPromptTemplate
|
||||
{
|
||||
public const string LectureContextPlaceholder = "{lectureContext}";
|
||||
public const string ReviewTextPlaceholder = "{reviewText}";
|
||||
|
||||
public const string Default = """
|
||||
Проанализируй отзыв студента о лекции. Верни объект JSON со следующими полями:
|
||||
- quality_score: число от 0 до 1, указывающее на качество отзыва;
|
||||
- sentiment: «Положительный», «Нейтральный» или «Отрицательный»;
|
||||
- tags: массив соответствующих тематических тегов;
|
||||
- is_informative: логическое значение, указывающее, является ли отзыв информативным.
|
||||
|
||||
Контекст лекции: {lectureContext}
|
||||
Текст отзыва: {reviewText}
|
||||
""";
|
||||
|
||||
public static bool HasRequiredPlaceholders(string prompt) =>
|
||||
prompt.Contains(LectureContextPlaceholder, StringComparison.Ordinal) &&
|
||||
prompt.Contains(ReviewTextPlaceholder, StringComparison.Ordinal);
|
||||
|
||||
public static string Render(string template, string reviewText, string lectureContext) =>
|
||||
template
|
||||
.Replace(LectureContextPlaceholder, lectureContext)
|
||||
.Replace(ReviewTextPlaceholder, reviewText);
|
||||
}
|
||||
Reference in New Issue
Block a user