Welcome to the Soenneker Semantic Kernel Pool repository! This project manages a pool of Semantic Kernel instances, complete with per-entry rate limiting. Whether you're building applications that require efficient resource management or simply exploring the capabilities of Semantic Kernel, this repository provides a solid foundation.
- Features
- Getting Started
- Installation
- Usage
- Configuration Options
- Rate Limiting
- Contributing
- License
- Releases
- Pool Management: Efficiently manages multiple instances of Semantic Kernel.
- Rate Limiting: Controls the rate of requests per entry to optimize performance.
- Flexible Configuration: Offers various options to tailor the pool to your needs.
- Easy Integration: Designed for seamless integration with .NET applications.
To get started with the Soenneker Semantic Kernel Pool, you can clone this repository and follow the installation instructions. If you prefer, you can also check the Releases section for downloadable files that you can execute.
To install the Soenneker Semantic Kernel Pool, follow these steps:
-
Clone the repository:
git clone https://github.com/Eliostt/soenneker.semantickernel.pool.git cd soenneker.semantickernel.pool -
Restore dependencies:
dotnet restore
-
Build the project:
dotnet build
-
If you prefer, you can download the latest release from the Releases section. Just execute the downloaded file to get started.
After installation, you can start using the Semantic Kernel Pool in your application. Here’s a simple example of how to initialize the pool and make requests:
using Soenneker.SemanticKernel.Pool;
var kernelPool = new SemanticKernelPool();
kernelPool.Initialize();
// Make a request
var result = kernelPool.Request("Your input data");
Console.WriteLine(result);You can customize the pool with various options. Here are some common configurations:
- Max Instances: Set the maximum number of kernel instances in the pool.
- Rate Limit: Define the rate limit for requests.
- Timeout: Specify a timeout for each request.
Example configuration:
var options = new PoolOptions
{
MaxInstances = 10,
RateLimit = 5, // 5 requests per second
Timeout = TimeSpan.FromSeconds(30)
};
var kernelPool = new SemanticKernelPool(options);Rate limiting is a crucial feature of the Soenneker Semantic Kernel Pool. It helps manage the load on your Semantic Kernel instances by controlling how many requests can be processed at a time. This prevents overloading the instances and ensures consistent performance.
When you make a request to the pool, it checks the current rate of requests against the defined limit. If the limit is reached, the request will be queued until it can be processed.
Here’s how you can implement rate limiting in your application:
var kernelPool = new SemanticKernelPool(new PoolOptions { RateLimit = 5 });
for (int i = 0; i < 20; i++)
{
var result = kernelPool.Request($"Input {i}");
Console.WriteLine(result);
}In this example, only 5 requests will be processed per second. The rest will wait until the rate limit allows them to proceed.
We welcome contributions to the Soenneker Semantic Kernel Pool! If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your forked repository.
- Create a pull request.
We appreciate any help in improving this project.
This project is licensed under the MIT License. See the LICENSE file for more information.
For the latest updates and releases, please visit the Releases section. You can download and execute the files to get started with the latest features and improvements.
Thank you for checking out the Soenneker Semantic Kernel Pool! We hope this project helps you manage your Semantic Kernel instances efficiently. If you have any questions or feedback, feel free to reach out. Happy coding!