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:
@@ -1,9 +1,9 @@
|
||||
using System.Net.Http.Json;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using UniVerse.Application.Interfaces;
|
||||
using UniVerse.Application.Prompts;
|
||||
|
||||
namespace UniVerse.Infrastructure.ExternalServices;
|
||||
|
||||
@@ -11,25 +11,25 @@ public class LlmClient : ILlmClient
|
||||
{
|
||||
private readonly HttpClient _http;
|
||||
private readonly IConfiguration _config;
|
||||
private readonly IReviewPromptService _reviewPrompts;
|
||||
private readonly ILogger<LlmClient> _logger;
|
||||
|
||||
public LlmClient(HttpClient http, IConfiguration config, ILogger<LlmClient> logger)
|
||||
public LlmClient(
|
||||
HttpClient http,
|
||||
IConfiguration config,
|
||||
IReviewPromptService reviewPrompts,
|
||||
ILogger<LlmClient> logger)
|
||||
{
|
||||
_http = http; _config = config; _logger = logger;
|
||||
_http = http;
|
||||
_config = config;
|
||||
_reviewPrompts = reviewPrompts;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<LlmReviewAnalysis> AnalyzeReviewAsync(string reviewText, string lectureContext)
|
||||
{
|
||||
var prompt = $"""
|
||||
Analyze the following student review of a lecture. Return a JSON object with:
|
||||
- quality_score: float 0-1 indicating review quality
|
||||
- sentiment: "Positive", "Neutral", or "Negative"
|
||||
- tags: array of relevant topic tags
|
||||
- is_informative: boolean indicating if the review is informative
|
||||
|
||||
Lecture context: {lectureContext}
|
||||
Review text: {reviewText}
|
||||
""";
|
||||
var promptSetting = await _reviewPrompts.GetAsync();
|
||||
var prompt = ReviewPromptTemplate.Render(promptSetting.Prompt, reviewText, lectureContext);
|
||||
|
||||
var request = new
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user