Skip to content

Commit

Permalink
fix: ensure modelName non-null
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmywork committed Dec 20, 2024
1 parent d047df9 commit cd1f6c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dotnet/src/AutoGen/LMStudioConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public LMStudioConfig(string host, int port, string modelName)
this.Host = host;
this.Port = port;
this.Uri = new Uri($"http://{host}:{port}/v1");
if (modelName == null)
throw new ArgumentNullException("modelName is a required property for LMStudioConfig and cannot be null");
this.ModelName = modelName;
}

Expand All @@ -26,6 +28,8 @@ public LMStudioConfig(Uri uri, string modelName)
this.Uri = uri;
this.Host = uri.Host;
this.Port = uri.Port;
if (modelName == null)
throw new ArgumentNullException("modelName is a required property for LMStudioConfig and cannot be null");
this.ModelName = modelName;
}

Expand Down

0 comments on commit cd1f6c1

Please sign in to comment.