GroqNet 0.9.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package GroqNet --version 0.9.0
NuGet\Install-Package GroqNet -Version 0.9.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GroqNet" Version="0.9.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GroqNet --version 0.9.0
#r "nuget: GroqNet, 0.9.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GroqNet as a Cake Addin
#addin nuget:?package=GroqNet&version=0.9.0

// Install GroqNet as a Cake Tool
#tool nuget:?package=GroqNet&version=0.9.0

Groq .NET Core Client Service

NuGet version (GroqNet) NuGet downloads (GroqNet) GitHub license

The Groq .NET Core is a library for interacting with the Groq API, the quickest LLM inference method available yet.

About

The library provides a simple and easy-to-use interface for accessing the Groq API, allowing developers to integrate the platform's capabilities into their applications.

Features

  • Sends HTTP requests to the Groq API
  • Handles rate limiting and retries when necessary
  • Supports JSON serialization and deserialization using System.Text.Json
  • Can be used with ILogger for logging

Installation

To install the Groq .NET Core Client Library, simply run the following command in your .NET Core project:

dotnet add package GroqNet

Usage

Here's an example of how to use the client library:

var apiKey = Environment.GetEnvironmentVariable("API_Key_Groq", EnvironmentVariableTarget.User);

var host = new HostBuilder()
    .ConfigureServices(services =>
    {
        services.AddHttpClient();
        services.AddGroqService(apiKey, GroqModel.LLaMA3_8b);
    }).Build();

var groqService = host.Services.GetRequiredService<GroqService>();

var conversation = new List<GroqMessage> 
{
    new GroqMessage(ChatRole.User, "What is the capital of France?")
};

var result = await groqService.GetChatCompletionAsync(conversation);

Console.WriteLine(result.Choices.First().Message.Content);

License

The Groq .NET Core Client Library is licensed under the MIT License.

Contribution

Contributions are welcome! If you find a bug or have an idea for a new feature, please open an issue and let us know.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 66 5/13/2024
1.0.0 63 5/2/2024
0.9.0 88 4/29/2024