This commit is contained in:
femsci 2023-11-18 16:31:51 +01:00
parent 51d188f2ed
commit a714da0ca7
Signed by: femsci
GPG key ID: 08F7911F0E650C67
7 changed files with 13 additions and 33 deletions

View file

@ -2,7 +2,7 @@ namespace Nyanlabs.Umogen.Core.Models;
public record ApiRequest
{
public string Model { get; set; } = "gpt-3.5-turbo";
public string Model { get; set; } = "gpt-4";
public float Temperature { get; set; } = 0.7f;
public ICollection<GptMessage> Messages { get; set; } = new List<GptMessage>();
public bool Stream { get; set; }

View file

@ -16,7 +16,7 @@ public record Person(string Name, string Surname, string IdC, string Pesel, Date
public DateTime? DoB { get; set; } = DoB;
[JsonIgnore]
public virtual ICollection<LegalEntity> Companies { get; set; }
public virtual ICollection<LegalEntity> Companies { get; set; } = default!;
public string GetName()
{

View file

@ -5,13 +5,13 @@ namespace Nyanlabs.Umogen.Core.Models;
public class UmoAnalModel
{
[JsonPropertyName("c_type")]
public string ContractType { get; set; }
public string ContractType { get; set; } = default!;
[JsonPropertyName("j_pos")]
public string JobPosition { get; set; }
public string JobPosition { get; set; } = default!;
[JsonPropertyName("k_lit")]
public string ValueLiteral { get; set; }
public string ValueLiteral { get; set; } = default!;
[JsonPropertyName("conds")]
public ICollection<string> Conditions { get; set; }
public ICollection<string> Conditions { get; set; } = default!;
public UmoDoctype Doctype => UmoDoctypeBindings.GetFromName(ContractType).Value;
public UmoDoctype Doctype => UmoDoctypeBindings.GetFromName(ContractType)!.Value;
}

View file

@ -32,7 +32,7 @@ public class UmoDocumentResult(UmoDoctype? type, Person employee, IEntity employ
.Replace(ENACT_DATE, DateTime.Now.ToString("dd.MM.yyyy"))
.Replace(ISSUE_DATE, DateTime.Now.ToString("dd.MM.yyyy"))
.Replace(PAYMENT_LIT, Anal.ValueLiteral)
.Replace(PAYMENT, Payment.Value.ToString())
.Replace(PAYMENT, Payment!.Value.ToString())
.Replace(WORK_TYPE, Anal.JobPosition)
.Replace(DYNAMIC_DATA, string.Join(", ", Anal.Conditions));
string tmp = Path.GetTempFileName();

View file

@ -71,7 +71,7 @@
private string _validityText = "";
private async Task ChgValidity(ChangeEventArgs e)
private void ChgValidity(ChangeEventArgs e)
{
string val = (string)e.Value!;
_validityText = val;
@ -129,11 +129,11 @@
}
var anal = System.Text.Json.JsonSerializer.Deserialize<UmoAnalModel>(output, Umogen.JSON_OPTS);
UmoDocumentResult res = new(null, employee, employer, _validity, _payment,
anal);
UmoDocumentResult res = new(null, employee!, employer!, _validity, _payment,
anal!);
var bytes = await res.ProcessPdf(Path.Combine(Environment.GetEnvironmentVariable("UMO_TEMPLATES")!,
anal.Doctype.TemplateDoc()));
anal!.Doctype.TemplateDoc()));
await js.InvokeVoidAsync("blobby", bytes);
disB = false;