Skip to content

Commit

Permalink
remove BaseUrl (use BaseAddress of HttpClient)
Browse files Browse the repository at this point in the history
  • Loading branch information
dclipca committed Jan 22, 2025
1 parent 8f92317 commit 4a4a985
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ using SpongeEngine.LMStudioSharp.Models.Chat;
// Configure the client
var options = new LmStudioClientOptions
{
BaseUrl = "http://localhost:1234"
HttpClient = new HttpClient
{
BaseAddress = new Uri("http://localhost:1234")
}
};

// Create client instance
Expand Down Expand Up @@ -86,8 +89,10 @@ await foreach (var token in client.StreamCompletionAsync(completionRequest))
```csharp
var options = new LmStudioClientOptions
{
BaseUrl = "http://localhost:1234", // LM Studio server URL
HttpClient = new HttpClient(), // Optional custom HttpClient
HttpClient = new HttpClient
{
BaseAddress = new Uri("http://localhost:1234")
}, // Configure HttpClient with base address
JsonSerializerOptions = new JsonSerializerOptions(), // Optional JSON options
Logger = loggerInstance // Optional ILogger instance
};
Expand Down Expand Up @@ -140,7 +145,10 @@ var logger = LoggerFactory

var options = new LmStudioClientOptions
{
BaseUrl = "http://localhost:1234",
HttpClient = new HttpClient
{
BaseAddress = new Uri("http://localhost:1234")
},
Logger = logger
};
var client = new LmStudioSharpClient(options);
Expand All @@ -157,7 +165,10 @@ var jsonOptions = new JsonSerializerOptions

var options = new LmStudioClientOptions
{
BaseUrl = "http://localhost:1234",
HttpClient = new HttpClient
{
BaseAddress = new Uri("http://localhost:1234")
},
JsonSerializerOptions = jsonOptions
};
var client = new LmStudioSharpClient(options);
Expand All @@ -184,4 +195,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
Contributions are welcome! Please feel free to submit a Pull Request.

## Support
For issues and feature requests, please use the [GitHub issues page](https://github.com/SpongeEngine/LMStudioSharp/issues).
For issues and feature requests, please use the [GitHub issues page](https://github.com/SpongeEngine/LMStudioSharp/issues).
5 changes: 1 addition & 4 deletions SpongeEngine.LMStudioSharp/LmStudioClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@

namespace SpongeEngine.LMStudioSharp
{
public class LmStudioClientOptions : LlmClientBaseOptions
{
public override string BaseUrl { get; set; } = "http://localhost:1234";
}
public class LmStudioClientOptions : LlmClientBaseOptions {}
}

0 comments on commit 4a4a985

Please sign in to comment.