@@ -134,7 +134,7 @@ protected LLMProvider(LlamaLib llamaLibInstance) : base(llamaLibInstance)
134134 {
135135 }
136136
137- public string Lora_Weight ( string jsonData )
137+ public string LoraWeight ( string jsonData )
138138 {
139139 if ( string . IsNullOrEmpty ( jsonData ) )
140140 throw new ArgumentNullException ( nameof ( jsonData ) ) ;
@@ -145,7 +145,7 @@ public string Lora_Weight(string jsonData)
145145 return Marshal . PtrToStringAnsi ( result ) ?? string . Empty ;
146146 }
147147
148- public string Lora_List ( )
148+ public string LoraList ( )
149149 {
150150 CheckLlamaLib ( ) ;
151151
@@ -174,7 +174,7 @@ public void Stop()
174174 llamaLib . LLM_Stop ( llm ) ;
175175 }
176176
177- public void Start_Server ( string host = "0.0.0.0" , int port = 0 , string apiKey = "" )
177+ public void StartServer ( string host = "0.0.0.0" , int port = 0 , string apiKey = "" )
178178 {
179179 CheckLlamaLib ( ) ;
180180
@@ -184,14 +184,14 @@ public void Start_Server(string host = "0.0.0.0", int port = 0, string apiKey =
184184 llamaLib . LLM_Start_Server ( llm , host , port , apiKey ?? string . Empty ) ;
185185 }
186186
187- public void Stop_Server ( )
187+ public void StopServer ( )
188188 {
189189 CheckLlamaLib ( ) ;
190190
191191 llamaLib . LLM_Stop_Server ( llm ) ;
192192 }
193193
194- public void Join_Service ( )
194+ public void JoinService ( )
195195 {
196196 CheckLlamaLib ( ) ;
197197
@@ -205,7 +205,7 @@ public void JoinServer()
205205 llamaLib . LLM_Join_Server ( llm ) ;
206206 }
207207
208- public void Set_SSL ( string sslCert , string sslKey )
208+ public void SetSSL ( string sslCert , string sslKey )
209209 {
210210 if ( string . IsNullOrEmpty ( sslCert ) )
211211 throw new ArgumentNullException ( nameof ( sslCert ) ) ;
@@ -217,25 +217,22 @@ public void Set_SSL(string sslCert, string sslKey)
217217 llamaLib . LLM_Set_SSL ( llm , sslCert , sslKey ) ;
218218 }
219219
220- public int Status_Code ( )
220+ public int StatusCode ( )
221221 {
222222 CheckLlamaLib ( ) ;
223-
224223 return llamaLib . LLM_Status_Code ( llm ) ;
225224 }
226225
227- public string Status_Message ( )
226+ public string StatusMessage ( )
228227 {
229228 CheckLlamaLib ( ) ;
230-
231229 var result = llamaLib . LLM_Status_Message ( llm ) ;
232230 return Marshal . PtrToStringAnsi ( result ) ?? string . Empty ;
233231 }
234232
235- public int Embedding_Size ( )
233+ public int EmbeddingSize ( )
236234 {
237235 CheckLlamaLib ( ) ;
238-
239236 return llamaLib . LLM_Embedding_Size ( llm ) ;
240237 }
241238
@@ -290,18 +287,19 @@ public LLMService(string modelPath, int numThreads = -1, int numGpuLayers = 0,
290287
291288 public LLMService ( LlamaLib llamaLibInstance , IntPtr llmInstance )
292289 {
293- llamaLib = llamaLibInstance ?? throw new ArgumentNullException ( nameof ( llamaLibInstance ) ) ;
290+ if ( llamaLibInstance == null ) throw new ArgumentNullException ( nameof ( llamaLibInstance ) ) ;
294291 if ( llmInstance == IntPtr . Zero ) throw new ArgumentNullException ( nameof ( llmInstance ) ) ;
292+ llamaLib = llamaLibInstance ;
295293 llm = llmInstance ;
296294 }
297295
298- public static LLMService From_Command ( string paramsString )
296+ public static LLMService FromCommand ( string paramsString )
299297 {
300298 if ( string . IsNullOrEmpty ( paramsString ) )
301299 throw new ArgumentNullException ( nameof ( paramsString ) ) ;
302300
303301 LlamaLib llamaLibInstance = null ;
304- IntPtr llmInstance ;
302+ IntPtr llmInstance = IntPtr . Zero ;
305303 try
306304 {
307305 llamaLibInstance = new LlamaLib ( LlamaLib . Has_GPU_Layers ( paramsString ) ) ;
0 commit comments