qwen.ASPClient 1.0.0

dotnet add package qwen.ASPClient --version 1.0.0
                    
NuGet\Install-Package qwen.ASPClient -Version 1.0.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="qwen.ASPClient" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="qwen.ASPClient" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="qwen.ASPClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add qwen.ASPClient --version 1.0.0
                    
#r "nuget: qwen.ASPClient, 1.0.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.
#addin nuget:?package=qwen.ASPClient&version=1.0.0
                    
Install qwen.ASPClient as a Cake Addin
#tool nuget:?package=qwen.ASPClient&version=1.0.0
                    
Install qwen.ASPClient as a Cake Tool

Qwen.ASPClient

Qwen.ASPClient is a lightweight and efficient ASP.NET wrapper for the Qwen AI API, providing seamless integration into .NET applications.

Features

  • Simple and fluent API
  • Supports Dependency Injection
  • Built-in error handling
  • Utilizes HttpClient best practices for performance

Installation

Install the package via NuGet:

dotnet add package Qwen.ASPClient

Usage Example

var client = new QwenClient("your-api-key");
var response = await client.GenerateResponseAsync("Hello Qwen!");
Console.WriteLine(response.Choices[0].Message.Content);

Dependency Injection

To register the client in an ASP.NET Core application:

services.AddSingleton<IQwenClient>(provider =>
    new QwenClient(Configuration["Qwen:ApiKey"]));

Error Handling

The library provides structured error handling with custom exceptions:

try
{
    var response = await client.GenerateResponseAsync("Tell me a joke!");
    Console.WriteLine(response.Choices[0].Message.Content);
}
catch (QwenException ex)
{
    Console.WriteLine($"Error: {ex.Message}");
}

Contributing

Contributions are welcome! If you'd like to contribute, please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature-name)
  3. Commit your changes (git commit -m "Add new feature")
  4. Push to the branch (git push origin feature-name)
  5. Open a Pull Request

Reporting Issues

If you encounter any issues or have feature requests, please open an issue on GitHub: Issues

License

This project is licensed under the MIT License - see the LICENSE file for details.


Created by Anwar Al-Hitar

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

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.0 113 2 months ago