LLM for Unity  v2.3.0
Create characters in Unity with LLMs!
Loading...
Searching...
No Matches
LLMInterface.cs
Go to the documentation of this file.
1
3using System;
4using System.Collections.Generic;
5
7namespace LLMUnity
8{
9 [Serializable]
10 public struct ChatRequest
11 {
12 public string prompt;
13 public int id_slot;
14 public float temperature;
15 public int top_k;
16 public float top_p;
17 public float min_p;
18 public int n_predict;
19 public int n_keep;
20 public bool stream;
21 public List<string> stop;
22 public float tfs_z;
23 public float typical_p;
24 public float repeat_penalty;
25 public int repeat_last_n;
26 public bool penalize_nl;
27 public float presence_penalty;
28 public float frequency_penalty;
29 public string penalty_prompt;
30 public int mirostat;
31 public float mirostat_tau;
32 public float mirostat_eta;
33 public string grammar;
34 public int seed;
35 public bool ignore_eos;
36 public Dictionary<int, string> logit_bias;
37 public int n_probs;
38 public bool cache_prompt;
39 public List<ChatMessage> messages;
40 }
41
42 [Serializable]
43 public struct SystemPromptRequest
44 {
45 public string prompt;
46 public string system_prompt;
47 public int n_predict;
48 }
49
50 [Serializable]
51 public struct ChatResult
52 {
53 public int id_slot;
54 public string content;
55 public bool stop;
56 public string generation_settings;
57 public string model;
58 public string prompt;
59 public bool stopped_eos;
60 public bool stopped_limit;
61 public bool stopped_word;
62 public string stopping_word;
63 public string timings;
64 public int tokens_cached;
65 public int tokens_evaluated;
66 public bool truncated;
67 public bool cache_prompt;
68 public bool system_prompt;
69 }
70
71 [Serializable]
72 public struct MultiChatResult
73 {
74 public List<ChatResult> data;
75 }
76
77 [Serializable]
78 public struct ChatMessage
79 {
80 public string role;
81 public string content;
82 }
83
84 [Serializable]
85 public struct TokenizeRequest
86 {
87 public string content;
88 }
89
90 [Serializable]
91 public struct TokenizeResult
92 {
93 public List<int> tokens;
94 }
95
96 [Serializable]
97 public struct EmbeddingsResult
98 {
99 public List<float> embedding;
100 }
101
102 [Serializable]
103 public struct LoraWeightRequest
104 {
105 public int id;
106 public float scale;
107 }
108
109 [Serializable]
110 public struct LoraWeightRequestList
111 {
112 public List<LoraWeightRequest> loraWeights;
113 }
114
115 [Serializable]
116 public struct LoraWeightResult
117 {
118 public int id;
119 public string path;
120 public float scale;
121 }
122
123 [Serializable]
124 public struct LoraWeightResultList
125 {
126 public List<LoraWeightResult> loraWeights;
127 }
128
129 [Serializable]
130 public struct TemplateResult
131 {
132 public string template;
133 }
134
135 [Serializable]
136 public struct SlotRequest
137 {
138 public int id_slot;
139 public string action;
140 public string filepath;
141 }
142
143 [Serializable]
144 public struct SlotResult
145 {
146 public int id_slot;
147 public string filename;
148 }
149}