mirror of
https://github.com/QuotifyTeam/QuotifyBE.git
synced 2025-12-16 19:00:07 +01:00
Compare commits
3 Commits
3e823fb37b
...
user_conte
| Author | SHA1 | Date | |
|---|---|---|---|
| 11d24dcc11 | |||
| bb9bdcfaa0 | |||
| 601d99bccd |
@@ -1,7 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using QuotifyBE.Data;
|
using QuotifyBE.Data;
|
||||||
using QuotifyBE.Entities;
|
using QuotifyBE.Entities;
|
||||||
using System.IdentityModel.Tokens.Jwt;
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
@@ -134,108 +132,4 @@ public class GeneralUseHelpers(ApplicationDbContext db, IConfiguration appsettin
|
|||||||
|
|
||||||
return new JwtSecurityTokenHandler().WriteToken(token);
|
return new JwtSecurityTokenHandler().WriteToken(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<JObject?> GenerateLLMResponse(string? prompt, string? model, float? temp, int? includedCategory, bool? includeCategorySample)
|
|
||||||
{
|
|
||||||
|
|
||||||
string _model = model ?? _appsettings.GetSection("LlmIntegration")["DefaultModel"] ?? "deepclaude";
|
|
||||||
float _temp = temp ?? 0.6f; // sane default
|
|
||||||
string _included_sample = string.Empty;
|
|
||||||
string _prompt = prompt ?? _appsettings.GetSection("LlmIntegration")["DefaultPrompt"] ??
|
|
||||||
"Cześć, czy jesteś w stanie wymyślić i stworzyć jeden oryginalny cytat? " +
|
|
||||||
"Zastanów się nad jego puentą, a kiedy będziesz gotów - zwróć sam cytat. " +
|
|
||||||
"Nie pytaj mnie co o nim sądzę, ani nie używaj emotikonów (emoji). " +
|
|
||||||
"Pamiętaj, że dobre cytaty są krótkie, zwięzłe.";
|
|
||||||
|
|
||||||
if (includedCategory != null)
|
|
||||||
{
|
|
||||||
// Check if category to be included is present.
|
|
||||||
Category? cat = await _db.Categories.FirstOrDefaultAsync(c => c.Id == includedCategory.Value);
|
|
||||||
// It isn't?
|
|
||||||
if (cat == null) return null;
|
|
||||||
// It is?
|
|
||||||
_prompt += $" Niech należy on do kategorii o nazwie \"{cat.Name}\" ({cat.Description}).";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sanity check
|
|
||||||
if (includeCategorySample != null && includeCategorySample == true)
|
|
||||||
{
|
|
||||||
if (includedCategory == null)
|
|
||||||
{
|
|
||||||
// Can't append something that we're not given.
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Try to find the category in question.
|
|
||||||
Category? cat = await _db.Categories.FirstOrDefaultAsync(c => c.Id == includedCategory.Value);
|
|
||||||
// Failed?
|
|
||||||
if (cat == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
IQueryable<Quote> query = _db.Quotes
|
|
||||||
.Include(q => q.QuoteCategories!)
|
|
||||||
.Where(q => q.QuoteCategories
|
|
||||||
.Any(qc => qc.Category == cat)
|
|
||||||
);
|
|
||||||
int totalQuotes = await query.CountAsync();
|
|
||||||
if (totalQuotes > 0) {
|
|
||||||
|
|
||||||
Random random = new();
|
|
||||||
int skip = random.Next(0, totalQuotes);
|
|
||||||
|
|
||||||
Quote? quote = await query
|
|
||||||
.Skip(skip)
|
|
||||||
.Take(1)
|
|
||||||
.FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
if (quote != null) {
|
|
||||||
_prompt += $" Przykładowy cytat z tej kategorii brzmi: \"{quote.Text} ~ {quote.Author}\".\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Dictionary<string, string>> promptMessages =
|
|
||||||
[
|
|
||||||
new() { { "role", "user" }, {"content", _prompt } }
|
|
||||||
];
|
|
||||||
|
|
||||||
// Will throw error if not present
|
|
||||||
string apiUrl = _appsettings.GetSection("LlmIntegration")["ApiUrl"] + "/chat/completions"
|
|
||||||
?? throw new MissingFieldException("API URL missing in LlmIntegration section of appsettings.json!");
|
|
||||||
string apiKey = _appsettings.GetSection("LlmIntegration")["ApiKey"]
|
|
||||||
?? throw new MissingFieldException("API key missing in LlmIntegration section of appsettings.json!");
|
|
||||||
|
|
||||||
using (var client = new HttpClient())
|
|
||||||
{
|
|
||||||
// Not the best practice if we want reusable connections
|
|
||||||
// https://stackoverflow.com/a/40707446
|
|
||||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");
|
|
||||||
var json = JsonConvert.SerializeObject(new
|
|
||||||
{
|
|
||||||
model = _model,
|
|
||||||
temperature = _temp,
|
|
||||||
max_tokens = (includeCategorySample ?? false) ? 2000 : 1000,
|
|
||||||
messages = promptMessages
|
|
||||||
});
|
|
||||||
var content = new StringContent(json, Encoding.UTF8, "application/json");
|
|
||||||
var response = await client.PostAsync(apiUrl, content);
|
|
||||||
if (response.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
string receivedResponse = await response.Content.ReadAsStringAsync();
|
|
||||||
return JObject.Parse(receivedResponse);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Handle the error
|
|
||||||
Console.WriteLine($"[QuotifyBE] Error: response status code from API was {response.StatusCode}.");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using Microsoft.AspNetCore.Authorization;
|
|||||||
using Microsoft.AspNetCore.Cors;
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using QuotifyBE.Data;
|
using QuotifyBE.Data;
|
||||||
using QuotifyBE.DTOs;
|
using QuotifyBE.DTOs;
|
||||||
using QuotifyBE.Entities;
|
using QuotifyBE.Entities;
|
||||||
@@ -482,75 +481,4 @@ public class QuotesController : ControllerBase
|
|||||||
return Ok(quote.ToQuoteShortDTO());
|
return Ok(quote.ToQuoteShortDTO());
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST /api/v1/quotes/ai
|
|
||||||
/// <summary>
|
|
||||||
/// [AUTHED] Request a LLM-generated quote
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Generated quote's text</returns>
|
|
||||||
/// <remarks>
|
|
||||||
/// <b>Notes</b>:<br/>
|
|
||||||
///
|
|
||||||
/// <ul>
|
|
||||||
/// If <i>customPrompt</i> is passed:
|
|
||||||
/// <li>The default prompt is overriden by whatever has been passed by the user.</li>
|
|
||||||
/// </ul><br/>
|
|
||||||
///
|
|
||||||
/// <ul>
|
|
||||||
/// If <i>model</i> is passed:
|
|
||||||
/// <li>The default large language model is overriden by whatever has been passed by the user.</li>
|
|
||||||
/// </ul><br/>
|
|
||||||
///
|
|
||||||
/// <ul>
|
|
||||||
/// If <i>temperature</i> is passed:
|
|
||||||
/// <li>The default temperature (= 0.8) is overriden by whatever has been passed by the user.</li>
|
|
||||||
/// </ul><br/>
|
|
||||||
///
|
|
||||||
/// <ul>
|
|
||||||
/// If <i>categoryId</i> is passed:
|
|
||||||
/// <li>The prompt is appended with an instruction in Polish to generate quotes based on the provided category
|
|
||||||
/// (both name and description get passed to the model).</li>
|
|
||||||
/// <li><b>Heads up!</b> The text is appended even if <i>customPrompt</i> has been provided.</li>
|
|
||||||
/// </ul><br/>
|
|
||||||
///
|
|
||||||
/// <ul>
|
|
||||||
/// If <i>useSampleQuote</i> is passed:
|
|
||||||
/// <li>The prompt will be appended with a randomly chosen quote from the categoryId (if any exist),
|
|
||||||
/// thus passing categoryId becomes a prerequisite.</li>
|
|
||||||
/// <li><b>Heads up!</b> The request will fail returning status code 400 if categoryId isn't provided!</li>
|
|
||||||
/// </ul>
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="request">Form data containing required quote information</param>
|
|
||||||
/// <response code="200">Returned on valid request</response>
|
|
||||||
/// <response code="400">Returned when generation failed due to remote server error (likely because of a bad request)</response>
|
|
||||||
/// <response code="500">Returned when response has been generated, but couldn't be parsed (likely because of incompatible server or bad URL)</response>
|
|
||||||
[HttpPost("ai")]
|
|
||||||
[Authorize]
|
|
||||||
[EnableCors]
|
|
||||||
[ProducesResponseType(200)]
|
|
||||||
[ProducesResponseType(typeof(ErrorDTO), 400)]
|
|
||||||
[ProducesResponseType(typeof(ErrorDTO), 500)]
|
|
||||||
public async Task<IActionResult> CreateLLMQuote([FromBody] AskLLMInDTO request)
|
|
||||||
{
|
|
||||||
|
|
||||||
JObject? generatedResponse = await guhf.GenerateLLMResponse(
|
|
||||||
request.CustomPrompt, request.Model, request.Temperature, request.CategoryId, request.UseSampleQuote
|
|
||||||
);
|
|
||||||
|
|
||||||
// Check if any errors occurred
|
|
||||||
if (generatedResponse == null)
|
|
||||||
{
|
|
||||||
return StatusCode(400, new ErrorDTO { Status = "error", Error_msg = "Generation failed most likely due to bad request" });
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse JSON to get the bot reply
|
|
||||||
string? llmResponse = generatedResponse["choices"]?[0]?["message"]?["content"]?.ToString().Trim('"');
|
|
||||||
|
|
||||||
// If response string is not where we expect it, return 500
|
|
||||||
if (llmResponse == null)
|
|
||||||
return StatusCode(500, new ErrorDTO { Status = "error", Error_msg = "Unexpected API response" });
|
|
||||||
|
|
||||||
// Otherwise, return the response
|
|
||||||
return Ok(new { Status = "ok", BotResponse = llmResponse });
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class UserContentController : ControllerBase
|
|||||||
/// Requires authorization with a JWT, has CORS set.
|
/// Requires authorization with a JWT, has CORS set.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <response code="200">Returned on valid request</response>
|
/// <response code="200">Returned on valid request</response>
|
||||||
[HttpGet]
|
[HttpGet("images")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[EnableCors]
|
[EnableCors]
|
||||||
[ProducesResponseType(typeof(List<Image>), 200)]
|
[ProducesResponseType(typeof(List<Image>), 200)]
|
||||||
@@ -60,59 +60,140 @@ public class UserContentController : ControllerBase
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Allows authorized users to publish images.
|
/// Allows authorized users to publish images.
|
||||||
/// A user-reachable path is returned on success.<br/>
|
/// A user-reachable path and image id is returned on success.<br/>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <response code="200">Returned on valid request</response>
|
/// <response code="200">Returned on valid request</response>
|
||||||
/// <response code="400">Returned when file extension is unknown</response>
|
/// <response code="400">Returned when request does not contain a file or the file is blank</response>
|
||||||
/// <response code="406">Returned when request does not follow user-provided config</response>
|
/// <response code="413">Returned when image size is too large</response>
|
||||||
[HttpPost]
|
/// <response code="415">Returned when file extension/mimetype is unknown</response>
|
||||||
|
[HttpPost("images")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[EnableCors]
|
[EnableCors]
|
||||||
[ProducesResponseType(200)]
|
[ProducesResponseType(200)]
|
||||||
[ProducesResponseType(typeof(ErrorDTO), 400)]
|
[ProducesResponseType(typeof(ErrorDTO), 400)]
|
||||||
[ProducesResponseType(typeof(ErrorDTO), 406)]
|
[ProducesResponseType(typeof(ErrorDTO), 413)]
|
||||||
|
[ProducesResponseType(typeof(ErrorDTO), 415)]
|
||||||
public IActionResult PostNewImage(IFormFile file)
|
public IActionResult PostNewImage(IFormFile file)
|
||||||
{
|
{
|
||||||
|
// Obsługa braku pliku
|
||||||
// Ideally, a hash of the file would be stored somewhere
|
if (file == null || file.Length == 0)
|
||||||
// in the database to have a basic redundancy check,
|
{
|
||||||
// but this will do for now. ~eee4
|
return BadRequest(new ErrorDTO
|
||||||
|
{
|
||||||
// A good idea would be to also check the Content-Type
|
|
||||||
// of submitted files. ~eee4
|
|
||||||
|
|
||||||
List<string> allowedExtensions = new List<string>() { ".jpg", ".jpeg", ".jfif", ".png", ".gif", ".avif", ".webp" };
|
|
||||||
|
|
||||||
string fileExtension = Path.GetExtension(file.FileName);
|
|
||||||
if (!allowedExtensions.Contains(fileExtension.ToLower())) {
|
|
||||||
return BadRequest(new ErrorDTO {
|
|
||||||
Status = "error",
|
Status = "error",
|
||||||
Error_msg = $"Unknown file extension. Please use one of the following: {string.Join(", ", allowedExtensions)}"
|
Error_msg = "No file was uploaded."
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO:
|
// Dozwolone rozszerzenia
|
||||||
// https://www.youtube.com/watch?v=6-FNejMrVuk
|
List<string> allowedExtensions = new List<string>() { ".jpg", ".jpeg", ".jfif", ".png", ".gif", ".avif", ".webp" };
|
||||||
|
string fileExtension = Path.GetExtension(file.FileName).ToLower();
|
||||||
|
|
||||||
// Sprawdź, czy plik spełnia ograniczenia:
|
if (!allowedExtensions.Contains(fileExtension))
|
||||||
// 1. Czy rozmiar jest mniejszy od _appsettings["UserContent"]["MaxFileSize"] ?
|
{
|
||||||
|
return StatusCode(415, new ErrorDTO
|
||||||
|
{
|
||||||
|
Status = "error",
|
||||||
|
Error_msg = $"Unknown file extension. Allowed: {string.Join(", ", allowedExtensions)}"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sprawdzenie typu MIME (opcjonalnie dokładniejsze)
|
||||||
|
if (!file.ContentType.StartsWith("image/"))
|
||||||
|
{
|
||||||
|
return StatusCode(415, new ErrorDTO
|
||||||
|
{
|
||||||
|
Status = "error",
|
||||||
|
Error_msg = "Uploaded file is not an image."
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Jeśli nie, zwróć ErrorDTO ze wiadomością: $"File size exceeds {_appsettings["UserContent"]["MaxFileSize"]}"
|
// Ograniczenie rozmiaru pliku do tego, ustawionego przez użytkownika
|
||||||
|
int MaxFileSize = int.TryParse(_appsettings.GetSection("UserContent")["MaxFileSize"], out int r)
|
||||||
|
? r
|
||||||
|
: 5 * 1024 * 1024;
|
||||||
|
if (file.Length > MaxFileSize)
|
||||||
|
{
|
||||||
|
return StatusCode(413, new ErrorDTO
|
||||||
|
{
|
||||||
|
Status = "error",
|
||||||
|
Error_msg = $"File size exceeds {MaxFileSize / 1024 / 1024} MB."
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generowanie unikalnej nazwy
|
||||||
|
string uniqueFileName = $"{Guid.NewGuid()}{fileExtension}";
|
||||||
|
string relativePath = $"/uploads/images/{uniqueFileName}";
|
||||||
|
string absolutePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads", "images", uniqueFileName);
|
||||||
|
|
||||||
// Zapisz plik na dysku z pseudolosową nazwą GUID
|
// Upewnij się, że katalog istnieje
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(absolutePath)!);
|
||||||
|
|
||||||
|
// Zapis pliku na dysk
|
||||||
|
using (var stream = new FileStream(absolutePath, FileMode.Create))
|
||||||
|
{
|
||||||
|
file.CopyTo(stream);
|
||||||
|
}
|
||||||
|
|
||||||
// Wrzucić go do folderu "uploads/images/"
|
// Dodaj do bazy
|
||||||
|
Image image = new Image { Url = relativePath };
|
||||||
|
_db.Images.Add(image);
|
||||||
|
_db.SaveChanges();
|
||||||
|
|
||||||
|
// Zwracany adres URL (np. do użytku w cytacie)
|
||||||
|
return Ok(new
|
||||||
|
{
|
||||||
|
Status = "ok",
|
||||||
|
Filepath = relativePath,
|
||||||
|
ImageId = image.Id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Stwórz URL postaci: "/uploads/images/<nazwa pliku>.<rozszerzenie>"
|
// DELETE /api/v1/uc/images/{id}
|
||||||
|
/// <summary>
|
||||||
|
/// [AUTHED] Delete an image
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Deletes an image, granted it exists. <br/>
|
||||||
|
/// <b>Note</b>:
|
||||||
|
/// If the image is a file on disk, it's also deleted.
|
||||||
|
/// </remarks>
|
||||||
|
/// <returns>Json with status</returns>
|
||||||
|
/// <param name="id">Image id which will be deleted</param>
|
||||||
|
/// <response code="200">Returned on valid request</response>
|
||||||
|
/// <response code="404">Returned when no such image exists</response>
|
||||||
|
[HttpDelete("images/{id}")]
|
||||||
|
[Authorize]
|
||||||
|
[EnableCors]
|
||||||
|
[ProducesResponseType(200)]
|
||||||
|
[ProducesResponseType(typeof(ErrorDTO), 404)]
|
||||||
|
public async Task<IActionResult> DeleteImage(int id)
|
||||||
|
{
|
||||||
|
// (Attempt to) find the image
|
||||||
|
Image? image = await _db.Images
|
||||||
|
.FirstOrDefaultAsync(q => q.Id == id);
|
||||||
|
// Failed?
|
||||||
|
if (image == null)
|
||||||
|
return NotFound(new { status = "error", error_msg = "Image not found" });
|
||||||
|
|
||||||
|
// If succeded, remove the image:
|
||||||
|
// - from disk - if saved locally
|
||||||
|
if (!string.IsNullOrEmpty(image.Url)) {
|
||||||
|
if (image.Url.StartsWith("/uploads/images/")) {
|
||||||
|
// delete from disk
|
||||||
|
int fileNameStart = image.Url.LastIndexOf('/');
|
||||||
|
string uniqueFileName = image.Url.Substring(fileNameStart + 1);
|
||||||
|
string absolutePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads", "images", uniqueFileName);
|
||||||
|
System.IO.File.Delete(absolutePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Zwróć powyższy URL
|
// - from db
|
||||||
return Ok(new { Status = "ok", Filepath = "miejsce na wspomniany URL" });
|
_db.Images.Remove(image);
|
||||||
|
await _db.SaveChangesAsync();
|
||||||
|
|
||||||
|
// Return ok
|
||||||
|
return Ok(new { Status = "ok" });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace QuotifyBE.DTOs;
|
|
||||||
|
|
||||||
public record class AskLLMInDTO
|
|
||||||
{
|
|
||||||
public string? CustomPrompt { get; set; }
|
|
||||||
public string? Model { get; set; } = "deepclaude";
|
|
||||||
public float? Temperature { get; set; } = 0.8f;
|
|
||||||
public int? CategoryId { get; set; } = null;
|
|
||||||
public bool? UseSampleQuote { get; set; } = false;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -151,5 +151,5 @@ app.UseAuthentication();
|
|||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
|
app.UseStaticFiles();
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
|
||||||
<PackageReference Include="Npgsql" Version="9.0.3" />
|
<PackageReference Include="Npgsql" Version="9.0.3" />
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.3" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.3" />
|
||||||
@@ -37,7 +36,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="uploads\images\" />
|
<Folder Include="wwwroot\uploads\images\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -2,16 +2,10 @@
|
|||||||
"JwtSecret": "this is a sample jwt secret token required for quotify - it needs to have at least 256 bits (32 bytes long)",
|
"JwtSecret": "this is a sample jwt secret token required for quotify - it needs to have at least 256 bits (32 bytes long)",
|
||||||
"DomainName": "example.com",
|
"DomainName": "example.com",
|
||||||
"CorsOrigins": [
|
"CorsOrigins": [
|
||||||
"https://localhost:7029", "http://localhost:5259", "http://localhost:5258", "http://localhost:3000", "http://example.com"
|
"http://localhost:5259", "http://localhost:5258", "http://localhost:3000", "http://example.com"
|
||||||
],
|
],
|
||||||
"UserContent": {
|
"UserContent": {
|
||||||
"MaxFileSize": 5242880
|
"MaxFileSize": 5242880,
|
||||||
},
|
|
||||||
"LlmIntegration": {
|
|
||||||
"ApiUrl": "URL to OpenAI-compatible API server, e.g. https://example.com/api/v1",
|
|
||||||
"ApiKey": "FILL ME for AI-generation capabilities",
|
|
||||||
"DefaultPrompt": "Cześć, czy jesteś w stanie wymyślić i stworzyć jeden oryginalny cytat?\nZastanów się nad jego puentą, a kiedy będziesz gotów - zwróć sam cytat.\nNie pytaj mnie co o nim sądzę, ani nie używaj emotikonów (emoji).\nPamiętaj, że dobre cytaty są krótkie, zwięzłe.",
|
|
||||||
"DefaultModel": "deepclaude"
|
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "Server=server-host;Database=db-name;Username=quotify-user;Password=user-secret"
|
"DefaultConnection": "Server=server-host;Database=db-name;Username=quotify-user;Password=user-secret"
|
||||||
|
|||||||
BIN
wwwroot/uploads/images/42cbadf4-7804-4fde-991c-d56eb1f4a1b4.png
Normal file
BIN
wwwroot/uploads/images/42cbadf4-7804-4fde-991c-d56eb1f4a1b4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 141 KiB |
Reference in New Issue
Block a user