More work
This commit is contained in:
1 parent
c06f06c6ce
commit
8b476e6939
20 files changed
+871
-22
No files matched your search
@@ -0,0 +1,37 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
public class LmStudioChatRequest
|
||||
{
|
||||
[JsonPropertyName("model")]
|
||||
public required string Model { get; set; }
|
||||
|
||||
[JsonPropertyName("system_prompt")]
|
||||
public string? SystemPrompt { get; set; }
|
||||
|
||||
[JsonPropertyName("input")]
|
||||
public required string Input { get; set; }
|
||||
|
||||
[JsonPropertyName("integrations")]
|
||||
public List<string>? Integrations { get; set; }
|
||||
|
||||
[JsonPropertyName("reasoning")]
|
||||
public string? Reasoning { get; set; }
|
||||
|
||||
[JsonPropertyName("temperature")]
|
||||
public double Temperature { get; set; }
|
||||
|
||||
[JsonPropertyName("top_p")]
|
||||
public double TopP { get; set; }
|
||||
|
||||
[JsonPropertyName("context_length")]
|
||||
public int ContextLength { get; set; }
|
||||
|
||||
[JsonPropertyName("max_output_tokens")]
|
||||
public int MaxOutputTokens { get; set; }
|
||||
|
||||
[JsonPropertyName("store")]
|
||||
public bool Store { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("stream")]
|
||||
public bool Stream { get; set; } = false;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PaperlessAI.Models.LMStudio;
|
||||
|
||||
public class LmStudioChatResponse
|
||||
{
|
||||
[JsonProperty("model_instance_id")]
|
||||
public string? ModelInstanceId { get; set; }
|
||||
|
||||
[JsonProperty("output")]
|
||||
List<LmStudioChatResponseOutput>? Outputs { get; set; }
|
||||
|
||||
public List<LmStudioChatResponseOutput>? GetOutputsByResponseType(string responseType)
|
||||
{
|
||||
return Outputs?.Where(x => x.Type?.ToUpper() == responseType.ToUpper()).ToList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PaperlessAI.Models.LMStudio;
|
||||
|
||||
public class LmStudioChatResponseOutput
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
[JsonProperty("tool")]
|
||||
public string? Tool { get; set; }
|
||||
|
||||
[JsonProperty("content")]
|
||||
public string? Content { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PaperlessAI.Models.LMStudio;
|
||||
|
||||
public class LmStudioLlmResponse
|
||||
{
|
||||
[JsonProperty("document_Id")]
|
||||
public long DocumentId { get; set; } = -1;
|
||||
|
||||
[JsonProperty("success")]
|
||||
public bool Success { get; set; } = false;
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string Message { get; set; } = string.Empty;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
public bool IsValid => !string.IsNullOrWhiteSpace(Message) && DocumentId != -1;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PaperlessAI.Models.LMStudio;
|
||||
|
||||
public class LmStudioUnloadModel
|
||||
{
|
||||
[JsonPropertyName("instance_id")]
|
||||
public required string InstanceId { get; set; }
|
||||
}
|
||||
Reference in new issue
Block a user